mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 05:11:03 +00:00
729a46113b
- Bug 1159056. Don't store a value in CSS pixels in a variable with type nscoord in ScrollFrameHelper::SetCoordAttribute. r=dholbert (432f06158) - Bug 1138442 - Disable reftests on Mulet in parity with B2G/B2G Desktop. r=ahal (8b5c55da7) - Don't clip in ComputeFrameMetrics if the scrollframe won't be layerized. (bug 1148582 part 2, r=tn) (088b6ef29) - Bug 1157579 - Make sure the visual scroll port size includes the area of scrollbars when used in TryLayout. r=tn (c35244374) - Bug 1139306: Fix margin sides for right-to-left scrollbars depending on the actual position of the scrollbar as determined by layout.scrollbar.side, r=tn (34328312d) - Fix some full zoom FrameMetrics changes not propagating to APZ. (bug 1147648, r=botond) (91f009ac4) - Bug 1159405 - Fix "Found a non-root APZ with no handoff parent". r=botond (09b0ddf07) - Bug 1161040 - Don't set a scrollparent on the root content document in the child process that points to itself. r=tn (d0dfbffb0) - Bug 1161040 - Add some assertions to guard against infinite loops in the handoff chains. r=botond (e6bae82e8) - Bug 1153539 patch 1 - Improve comments for nsLayoutUtils::ComputeSuitableScaleForAnimation. r=roc (1b2bc00cd) - Bug 1153539 patch 2 - Compute scale for rasterizing off-main-thread transform animations based on ratio to display size in addition to maximum and minimum scale. r=roc (97d632d0f) - Bug 1160250 - Extract a helper method from the triplicated comp-bounds function to determine if we need to deflate the scrollbars. r=botond,tn (8d79c845f) - Bug 1160250 - Extract a helper function from the triplicated composition-bounds-updating code. r=botond,tn (5b3f71329) - Bug 1160250 - Collapse the code from CalculateRootCompositionSize into UpdateCompositionBounds. r=botond,tn (db0f081d6) - Bug 1160250 - Put in a missing transfomToAncestor scaling factor. r=botond,tn (14837aa3a) - Bug 1160250 - Fix up the rect being used for the composition size calculation. r=tn (0ba58021f) - Bug 1139575 - Reset velocity on axes when going from a pan to a pinch. r=botond (2e03d04ab) - Bug 1136971 - Draw layer borders correctly in the presence of multi-FrameMetrics. r=kats (e72f5b171) - Bug 1148871 - Only apply checkerboarding background color to opaque layers. r=botond (20e070b84) - Bug 1157327 - Don't cull out container layers, because their prepared data might be null and cause crashes. r=nical (3d06c925f) - Bug 1157327 follow-up to add a comment. r=me and DONTBUILD (4cd74c0a1) - Bug 1160566 - Make FrameMetrics.mCompositionBounds private and add a getter/setter for it. r=botond (277dd9afd) - Bug 1160566 - Change some return values to be reference-to-const. r=botond (2ce17b63f) - Bug 1158933 - Prevent scrollbars from jumping while zoomed in the B2G browser. r=botond (eca8aae7d) - Bug 1158933 - Replace the compositedHeight/scrollableHeight (and width) term with the adjusted scrollThumbRatio. r=botond (236af4c4a) - Bug 1156401 - Fix painting when building fennec with apzc. r=kats, r=botond (be18764b9) - Bug 1159305 - patch 1 - Provide logical accessors for nsStylePosition and nsStyleSides fields. r=dbaron (7a90c519d) - Bug 1159305 - patch 2 - Clean up layout code by using the new accessors. r=smontagu (926eb7dd5) - Bug 1164406 - Expose scrollbar-area deflation in nsLayoutUtils. r=kats (42e5e8784) - Bug 1139895 - Add fuzz for 1062792-1.html. r=tn (e38d0ac73) - Bug 1139893 - Disable reftest bugs/1062108-1.html on mulet. r=jfkthame (930590d73) - Move the APZ scroll frame clip onto FrameMetrics. (bug 1148582 part 3, r=mstange,tn) (c8e05f8d7) - Fix PostprocessRetainedLayers to not test occlusion with asynchronous clips. (bug 1148582 part 5, r=tn) (cc71cafe2) - Bug 1146626 - Refresh the reftest snapshot after adjusting the async scroll offsets. r=roc (1f041955d) - Bug 1160642. Add reftest-async-zoom to apply an async zoom before taking snapshot. r=dbaron (1e8e54d8d) - Bug 1160285 - Add a staticruntime version of mfbt and link some stuff against it. r=glandium (c733c49c7) - Bug 786520 - Install things to $(DIST)/branding from moz.build instead of manual rules in Makefile.ins. r=mshal (42d38eb26) - Bug 1155776 - move USE_EXTENSION_MANIFEST to moz.build; r=mshal (a87ecc2ca) - Bug 1155816 - part 0 - remove NO_JS_MANIFEST from testing/mochitest/Makefile.in; r=mshal (af90a362c) - Bug 1155816 - part 1 - move NO_JS_MANIFEST to moz.build; r=mshal (3a55e99a0) - Bug 978591 - Remove per-directory uses of MOZ_CHROME_FILE_FORMAT. r=glandium (5084d62b5) - Bug 991983 - Set GARBAGE for GeneratedSources in the recursivemake backend. r=gps (b8ae57c14) - Bug 991983 - Emit absolute paths for UnifiedSources. r=gps (4100640d0) - Bug 991983 - Emit absolute paths for other sources. r=gps (f30ddd773) - Bug 991983 - Remove commented code in gyp_reader.py. r=gps (0685eca6a) - Bug 1167474 - Remove ELFHACK_BUILD hack. r=mshal (b9d56c0b2) - Bug 1097804 - Part 1 - Create a library containing nsISocketTransportService and nsIDNS that can be used to support standalone WebRTC. r=mcmanus (d2f83eb1c) - Bug 1097804 - Part 2 - Added xpcomrt build of library containing unicode util functions. r=gps (fa9306f34) - Bug 1162852 - Remove EXTRA_COMPILE_FLAGS. r=gps (340312bc6) - Bug 1162852 - Remove EXTRA_ASSEMBLER_FLAGS. r=gps (f124c902c) - Bug 1162852 - Remove the VARIABLES method of GypContext now it is doing nothing. r=gps (b6c1c0246) - accidental commit (a1bbb1ada) - Bug 991983 - Define SOURCES as SourcePath. r=gps (678065bce) - Bug 991983 - Use objdir-relative SOURCES instead of GENERATED_SOURCES. r=gps (b54db0304) - Bug 991983 - Make TEST_HARNESS_FILES use the *Path classes instead of a separate set of methods to resolve paths. r=gps (025fe1ca9) - Bug 991983 - Add a deprecation hint for GENERATED_SOURCES. r=gps (67c75f4ab) - Bug 1172800 - Fixup after bug 991983. r=gps (ce6e8c7a3) - Bug 1164218 - Allow running individual mochitests and reftests in chaos mode. r=roc,froydnj (f2ec1d9d8) - Bug 1154231 - Part 1. Use LRU to manage remote layers. r=mattwoodrow (1fe47e64f) - Bug 1128037 - Minimalist support for wildcards in jar manifests. r=gps (1b07a6ffc) - Bug 1162569 - default engine files should be in the omni.ja file, r=markh,glandium. (b07e54881) - Bug 1157279. Escaping CSS identifiers should use lowercase letters for hex digits, not uppercase ones. r=dbaron (6f220936e)
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 "nsDebug.h" // for NS_ERROR
|
|
#include "nsPoint.h" // for nsIntPoint
|
|
#include "nsRect.h" // for mozilla::gfx::IntRect
|
|
#include "nsSize.h" // for nsIntSize
|
|
|
|
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=%llu, p=%u, v=%llu }", 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());
|
|
}
|
|
}
|