mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
cafd4d45b3
- Bug 1168630. Part 1. Add layers id to hit test node. r=botond (710ee191d) - Bug 1168630. Part 2. Only return an APZC from GetAPZCAtPoint that has the same layers id as the layer that was hit. r=botond (61adedf3c) - Bug 1168630. Part 3. Add IsLayersIdRoot to frame metrics. r=botond (4ebd296b3) - Bug 1151663 - Extract some helper functions for writing APZ mochitests into a separate file. r=kats (eacc622a4) - Bug 1168630. Part 4. Rename AsyncPanZoomController::IsRootForLayersId to HasNoParentWithSameLayersId. r=botond (0e543aa5c) - Bug 1168630. Part 5. If GetAPZCAtPoint hit a layer but did not find an APZC on the ancestor chain with the same layers id then return the root APZC of the same layers id. r=botond (40462b612) - Bug 1168630. Part 6. Modify the test for bug 1119497 based on the new assumption of always having a root APZC. r=botond (4ae4a4631) - Use the correct scrollframe clips with nested scrollframes in APZ. (bug 1148582 part 6, r=botond) (15c7c447d) - Fix asynchronously scrolling containerful subframes. (bug 1148582 part 6.1, r=tn) (abab9c2ca) - Bug 994541 - Skip 789933-1.html on Linux debug due to frequent crashes. (20854625f) - Bug 1184349 - Add lr to SavedNonVolatileRegisters on ARM64. r=efaust (b6aa8e624) - pointer style (01aaf5ffd) - Bug 1186122 - Part 1/2 - Remove StackPointer on ARM64. r=efaust (ac1171b98) - Bug 1185757 - Fix manual manipulation of StackPointer for JSOP_IN. r=efaust (eff86b56b) - Bug 1186122 - Part 2/2 - Remove BaselineStackReg from ARM64. r=efaust (c64f767ad) - Bug 1188650 - Part 2/2 - Make shared/LOpcodes-shared.h. r=nbp (fcd067fe3) - Bug 1182936 part 2 - IonMonkey: MIPS32: Move mips macros to mips32. r=nbp (dc17ea527) - Bug 1134744 - Reftest for baseline of radio button and checkbox. r=smontagu (9fd9e79ca) - Bug 1136557 - Reftests with nested spans in vertical mode. r=smontagu (7971e5104) - Bug 1142928 - Make 1090168-3.html fuzzy on Mulet as on B2G. r=jfkthame (6797807c9) - Bug 1134849 - Reftest for orthogonal inline elements. r=dbaron (d44daa3ef) - Bug 1082249. Invalidate background-attachment:fixed table-part backgrounds when scrolled. r=mattwoodrow (2df3218b3) - Bug 1144080 - Disable reftests on Mulet for TaskCluster. r=ahal (2a26fa749) - Bug 1145218 followup - Mark 1136557-*-nested-spans reftests fuzzy on Windows. no_r=me (833fab4ca) - Bug 1130907 - patch 1 - Account for writing-mode when incorporating border widths into intrinsic size. r=smontagu (a3b0dfa1c) - Bug 1130907 - patch 2 - Account for writing-mode in nsContainerFrame::DoInlineIntrinsicISize. r=smontagu (33f5c2333) - Bug 1130907 - patch 3 - Reftest for contribution of border widths to intrinsic size. r=smontagu (cafc14f18) - Bug 1130907 - patch 4 - Reftest for container-frame intrinsic size involving borders. r=smontagu (5b2898c3e) - Bug 1145936 - Reftest for sizing of foreignObject with vertical writing mode. r=smontagu (28ce89062) - Bug 1047973 - pattern with patternUnits=objectBoundingBox and preserveAspectRatio=... meet stretches to the size of a shape. r=dholbert (bb40de381) - Bug 1142982 - implement dominant-baseline=middle properly. r=heycam (20c0c9d66) - Bug 932958 - Use the Skia Software backend by default for canvas on OS X. r=jrmuizel (08c78d8dd)
353 lines
10 KiB
C++
353 lines
10 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
* vim: sw=2 ts=8 et :
|
|
*/
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "LayersLogging.h"
|
|
#include <stdint.h> // for uint8_t
|
|
#include "gfxColor.h" // for gfxRGBA
|
|
#include "mozilla/gfx/Matrix.h" // for Matrix4x4, Matrix
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
|
#include "nsDebug.h" // for NS_ERROR
|
|
#include "nsPoint.h" // for nsIntPoint
|
|
#include "nsRect.h" // for mozilla::gfx::IntRect
|
|
|
|
using namespace mozilla::gfx;
|
|
|
|
namespace mozilla {
|
|
namespace layers {
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const void* p,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
aStream << nsPrintfCString("%p", p).get();
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const GraphicsFilter& f,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
switch (f) {
|
|
case GraphicsFilter::FILTER_FAST: aStream << "fast"; break;
|
|
case GraphicsFilter::FILTER_GOOD: aStream << "good"; break;
|
|
case GraphicsFilter::FILTER_BEST: aStream << "best"; break;
|
|
case GraphicsFilter::FILTER_NEAREST: aStream << "nearest"; break;
|
|
case GraphicsFilter::FILTER_BILINEAR: aStream << "bilinear"; break;
|
|
case GraphicsFilter::FILTER_GAUSSIAN: aStream << "gaussian"; break;
|
|
default:
|
|
NS_ERROR("unknown filter type");
|
|
aStream << "???";
|
|
}
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, FrameMetrics::ViewID n,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
aStream << n;
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const gfxRGBA& c,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
aStream << nsPrintfCString(
|
|
"rgba(%d, %d, %d, %g)",
|
|
uint8_t(c.r*255.0), uint8_t(c.g*255.0), uint8_t(c.b*255.0), c.a).get();
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const nsPoint& p,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
aStream << nsPrintfCString("(x=%d, y=%d)", p.x, p.y).get();
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const nsRect& r,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
aStream << nsPrintfCString(
|
|
"(x=%d, y=%d, w=%d, h=%d)",
|
|
r.x, r.y, r.width, r.height).get();
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const nsIntPoint& p,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
aStream << nsPrintfCString("(x=%d, y=%d)", p.x, p.y).get();
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const IntRect& r,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
aStream << nsPrintfCString(
|
|
"(x=%d, y=%d, w=%d, h=%d)",
|
|
r.x, r.y, r.width, r.height).get();
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const nsRegion& r,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
|
|
nsRegionRectIterator it(r);
|
|
aStream << "< ";
|
|
while (const nsRect* sr = it.Next()) {
|
|
AppendToString(aStream, *sr);
|
|
aStream << "; ";
|
|
}
|
|
aStream << ">";
|
|
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const nsIntRegion& r,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
|
|
nsIntRegionRectIterator it(r);
|
|
aStream << "< ";
|
|
while (const IntRect* sr = it.Next()) {
|
|
AppendToString(aStream, *sr);
|
|
aStream << "; ";
|
|
}
|
|
aStream << ">";
|
|
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const EventRegions& e,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx << "{";
|
|
if (!e.mHitRegion.IsEmpty()) {
|
|
AppendToString(aStream, e.mHitRegion, " hitregion=", "");
|
|
}
|
|
if (!e.mDispatchToContentHitRegion.IsEmpty()) {
|
|
AppendToString(aStream, e.mDispatchToContentHitRegion, " dispatchtocontentregion=", "");
|
|
}
|
|
if (!e.mNoActionRegion.IsEmpty()) {
|
|
AppendToString(aStream, e.mNoActionRegion, " NoActionRegion=","");
|
|
}
|
|
if (!e.mHorizontalPanRegion.IsEmpty()) {
|
|
AppendToString(aStream, e.mHorizontalPanRegion, " HorizontalPanRegion=", "");
|
|
}
|
|
if (!e.mVerticalPanRegion.IsEmpty()) {
|
|
AppendToString(aStream, e.mVerticalPanRegion, " VerticalPanRegion=", "");
|
|
}
|
|
aStream << "}" << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const FrameMetrics& m,
|
|
const char* pfx, const char* sfx, bool detailed)
|
|
{
|
|
aStream << pfx;
|
|
AppendToString(aStream, m.GetCompositionBounds(), "{ [cb=");
|
|
AppendToString(aStream, m.GetScrollableRect(), "] [sr=");
|
|
AppendToString(aStream, m.GetScrollOffset(), "] [s=");
|
|
if (m.GetDoSmoothScroll()) {
|
|
AppendToString(aStream, m.GetSmoothScrollOffset(), "] [ss=");
|
|
}
|
|
AppendToString(aStream, m.GetDisplayPort(), "] [dp=");
|
|
AppendToString(aStream, m.GetCriticalDisplayPort(), "] [cdp=");
|
|
AppendToString(aStream, m.GetBackgroundColor(), "] [color=");
|
|
if (!detailed) {
|
|
AppendToString(aStream, m.GetScrollId(), "] [scrollId=");
|
|
if (m.GetScrollParentId() != FrameMetrics::NULL_SCROLL_ID) {
|
|
AppendToString(aStream, m.GetScrollParentId(), "] [scrollParent=");
|
|
}
|
|
if (m.HasClipRect()) {
|
|
AppendToString(aStream, m.ClipRect(), "] [clip=");
|
|
}
|
|
AppendToString(aStream, m.GetZoom(), "] [z=", "] }");
|
|
} else {
|
|
AppendToString(aStream, m.GetDisplayPortMargins(), " [dpm=");
|
|
aStream << nsPrintfCString("] um=%d", m.GetUseDisplayPortMargins()).get();
|
|
AppendToString(aStream, m.GetRootCompositionSize(), "] [rcs=");
|
|
AppendToString(aStream, m.GetViewport(), "] [v=");
|
|
aStream << nsPrintfCString("] [z=(ld=%.3f r=%.3f",
|
|
m.GetDevPixelsPerCSSPixel().scale,
|
|
m.GetPresShellResolution()).get();
|
|
AppendToString(aStream, m.GetCumulativeResolution(), " cr=");
|
|
AppendToString(aStream, m.GetZoom(), " z=");
|
|
AppendToString(aStream, m.GetExtraResolution(), " er=");
|
|
aStream << nsPrintfCString(")] [u=(%d %d %lu)",
|
|
m.GetScrollOffsetUpdated(), m.GetDoSmoothScroll(),
|
|
m.GetScrollGeneration()).get();
|
|
AppendToString(aStream, m.GetScrollParentId(), "] [p=");
|
|
aStream << nsPrintfCString("] [i=(%ld %lld)] }",
|
|
m.GetPresShellId(), m.GetScrollId()).get();
|
|
}
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const ScrollableLayerGuid& s,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx
|
|
<< nsPrintfCString("{ l=%" PRIu64 ", p=%u, v=%" PRIu64 " }", s.mLayersId, s.mPresShellId, s.mScrollId).get()
|
|
<< sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const Matrix4x4& m,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
if (m.Is2D()) {
|
|
Matrix matrix = m.As2D();
|
|
if (matrix.IsIdentity()) {
|
|
aStream << "[ I ]";
|
|
aStream << sfx;
|
|
return;
|
|
}
|
|
aStream << nsPrintfCString(
|
|
"[ %g %g; %g %g; %g %g; ]",
|
|
matrix._11, matrix._12, matrix._21, matrix._22, matrix._31, matrix._32).get();
|
|
} else {
|
|
aStream << nsPrintfCString(
|
|
"[ %g %g %g %g; %g %g %g %g; %g %g %g %g; %g %g %g %g; ]",
|
|
m._11, m._12, m._13, m._14,
|
|
m._21, m._22, m._23, m._24,
|
|
m._31, m._32, m._33, m._34,
|
|
m._41, m._42, m._43, m._44).get();
|
|
}
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const Matrix5x4& m,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
aStream << nsPrintfCString(
|
|
"[ %g %g %g %g; %g %g %g %g; %g %g %g %g; %g %g %g %g; %g %g %g %g]",
|
|
m._11, m._12, m._13, m._14,
|
|
m._21, m._22, m._23, m._24,
|
|
m._31, m._32, m._33, m._34,
|
|
m._41, m._42, m._43, m._44,
|
|
m._51, m._52, m._53, m._54).get();
|
|
aStream << sfx;
|
|
}
|
|
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, const Filter filter,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
|
|
switch (filter) {
|
|
case Filter::GOOD: aStream << "Filter::GOOD"; break;
|
|
case Filter::LINEAR: aStream << "Filter::LINEAR"; break;
|
|
case Filter::POINT: aStream << "Filter::POINT"; break;
|
|
}
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, TextureFlags flags,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
if (flags == TextureFlags::NO_FLAGS) {
|
|
aStream << "NoFlags";
|
|
} else {
|
|
|
|
#define AppendFlag(test) \
|
|
{ \
|
|
if (!!(flags & test)) { \
|
|
if (previous) { \
|
|
aStream << "|"; \
|
|
} \
|
|
aStream << #test; \
|
|
previous = true; \
|
|
} \
|
|
}
|
|
bool previous = false;
|
|
AppendFlag(TextureFlags::USE_NEAREST_FILTER);
|
|
AppendFlag(TextureFlags::ORIGIN_BOTTOM_LEFT);
|
|
AppendFlag(TextureFlags::DISALLOW_BIGIMAGE);
|
|
|
|
#undef AppendFlag
|
|
}
|
|
aStream << sfx;
|
|
}
|
|
|
|
void
|
|
AppendToString(std::stringstream& aStream, mozilla::gfx::SurfaceFormat format,
|
|
const char* pfx, const char* sfx)
|
|
{
|
|
aStream << pfx;
|
|
switch (format) {
|
|
case SurfaceFormat::B8G8R8A8: aStream << "SurfaceFormat::B8G8R8A8"; break;
|
|
case SurfaceFormat::B8G8R8X8: aStream << "SurfaceFormat::B8G8R8X8"; break;
|
|
case SurfaceFormat::R8G8B8A8: aStream << "SurfaceFormat::R8G8B8A8"; break;
|
|
case SurfaceFormat::R8G8B8X8: aStream << "SurfaceFormat::R8G8B8X8"; break;
|
|
case SurfaceFormat::R5G6B5: aStream << "SurfaceFormat::R5G6B5"; break;
|
|
case SurfaceFormat::A8: aStream << "SurfaceFormat::A8"; break;
|
|
case SurfaceFormat::YUV: aStream << "SurfaceFormat::YUV"; break;
|
|
case SurfaceFormat::UNKNOWN: aStream << "SurfaceFormat::UNKNOWN"; break;
|
|
}
|
|
|
|
aStream << sfx;
|
|
}
|
|
|
|
} // namespace layers
|
|
} // namespace mozilla
|
|
|
|
void
|
|
print_stderr(std::stringstream& aStr)
|
|
{
|
|
#if defined(ANDROID)
|
|
// On Android logcat output is truncated to 1024 chars per line, and
|
|
// we usually use std::stringstream to build up giant multi-line gobs
|
|
// of output. So to avoid the truncation we find the newlines and
|
|
// print the lines individually.
|
|
std::string line;
|
|
while (std::getline(aStr, line)) {
|
|
printf_stderr("%s\n", line.c_str());
|
|
}
|
|
#else
|
|
printf_stderr("%s", aStr.str().c_str());
|
|
#endif
|
|
}
|
|
|
|
void
|
|
fprint_stderr(FILE* aFile, std::stringstream& aStr)
|
|
{
|
|
if (aFile == stderr) {
|
|
print_stderr(aStr);
|
|
} else {
|
|
fprintf_stderr(aFile, "%s", aStr.str().c_str());
|
|
}
|
|
}
|