summaryrefslogtreecommitdiff
path: root/mozilla-1319374.patch
diff options
context:
space:
mode:
Diffstat (limited to 'mozilla-1319374.patch')
-rw-r--r--mozilla-1319374.patch164
1 files changed, 164 insertions, 0 deletions
diff --git a/mozilla-1319374.patch b/mozilla-1319374.patch
new file mode 100644
index 0000000..33a0944
--- /dev/null
+++ b/mozilla-1319374.patch
@@ -0,0 +1,164 @@
+diff -up firefox-51.0/gfx/2d/BorrowedContext.h.1319374 firefox-51.0/gfx/2d/BorrowedContext.h
+--- firefox-51.0/gfx/2d/BorrowedContext.h.1319374 2017-01-16 17:16:49.000000000 +0100
++++ firefox-51.0/gfx/2d/BorrowedContext.h 2017-01-20 09:30:07.619753937 +0100
+@@ -195,8 +195,18 @@ public:
+
+ CGContextRef cg;
+ private:
++#ifdef USE_SKIA
+ static CGContextRef BorrowCGContextFromDrawTarget(DrawTarget *aDT);
+ static void ReturnCGContextToDrawTarget(DrawTarget *aDT, CGContextRef cg);
++#else
++ static CGContextRef BorrowCGContextFromDrawTarget(DrawTarget *aDT) {
++ MOZ_CRASH("Not supported without Skia");
++ }
++
++ static void ReturnCGContextToDrawTarget(DrawTarget *aDT, CGContextRef cg) {
++ MOZ_CRASH("not supported without Skia");
++ }
++#endif
+ DrawTarget *mDT;
+ };
+ #endif
+diff -up firefox-51.0/gfx/layers/composite/LayerManagerComposite.cpp.1319374 firefox-51.0/gfx/layers/composite/LayerManagerComposite.cpp
+--- firefox-51.0/gfx/layers/composite/LayerManagerComposite.cpp.1319374 2017-01-16 17:16:50.000000000 +0100
++++ firefox-51.0/gfx/layers/composite/LayerManagerComposite.cpp 2017-01-20 09:30:07.619753937 +0100
+@@ -12,7 +12,6 @@
+ #include "CompositableHost.h" // for CompositableHost
+ #include "ContainerLayerComposite.h" // for ContainerLayerComposite, etc
+ #include "FPSCounter.h" // for FPSState, FPSCounter
+-#include "PaintCounter.h" // For PaintCounter
+ #include "FrameMetrics.h" // for FrameMetrics
+ #include "GeckoProfiler.h" // for profiler_set_frame_number, etc
+ #include "ImageLayerComposite.h" // for ImageLayerComposite
+@@ -133,6 +132,10 @@ LayerManagerComposite::LayerManagerCompo
+ {
+ mTextRenderer = new TextRenderer(aCompositor);
+ MOZ_ASSERT(aCompositor);
++
++#ifdef USE_SKIA
++ mPaintCounter = nullptr;
++#endif
+ }
+
+ LayerManagerComposite::~LayerManagerComposite()
+@@ -151,8 +154,11 @@ LayerManagerComposite::Destroy()
+ }
+ mRoot = nullptr;
+ mClonedLayerTreeProperties = nullptr;
+- mPaintCounter = nullptr;
+ mDestroyed = true;
++
++#ifdef USE_SKIA
++ mPaintCounter = nullptr;
++#endif
+ }
+ }
+
+@@ -564,7 +570,6 @@ LayerManagerComposite::InvalidateDebugOv
+ bool drawFps = gfxPrefs::LayersDrawFPS();
+ bool drawFrameCounter = gfxPrefs::DrawFrameCounter();
+ bool drawFrameColorBars = gfxPrefs::CompositorDrawColorBars();
+- bool drawPaintTimes = gfxPrefs::AlwaysPaint();
+
+ if (drawFps || drawFrameCounter) {
+ aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 256, 256));
+@@ -572,11 +577,16 @@ LayerManagerComposite::InvalidateDebugOv
+ if (drawFrameColorBars) {
+ aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 10, aBounds.height));
+ }
++
++#ifdef USE_SKIA
++ bool drawPaintTimes = gfxPrefs::AlwaysPaint();
+ if (drawPaintTimes) {
+ aInvalidRegion.Or(aInvalidRegion, nsIntRect(PaintCounter::GetPaintRect()));
+ }
++#endif
+ }
+
++#ifdef USE_SKIA
+ void
+ LayerManagerComposite::DrawPaintTimes(Compositor* aCompositor)
+ {
+@@ -587,6 +597,7 @@ LayerManagerComposite::DrawPaintTimes(Co
+ TimeDuration compositeTime = TimeStamp::Now() - mRenderStartTime;
+ mPaintCounter->Draw(aCompositor, mLastPaintTime, compositeTime);
+ }
++#endif
+
+ static uint16_t sFrameCount = 0;
+ void
+@@ -595,7 +606,6 @@ LayerManagerComposite::RenderDebugOverla
+ bool drawFps = gfxPrefs::LayersDrawFPS();
+ bool drawFrameCounter = gfxPrefs::DrawFrameCounter();
+ bool drawFrameColorBars = gfxPrefs::CompositorDrawColorBars();
+- bool drawPaintTimes = gfxPrefs::AlwaysPaint();
+
+ TimeStamp now = TimeStamp::Now();
+
+@@ -736,9 +746,12 @@ LayerManagerComposite::RenderDebugOverla
+ sFrameCount++;
+ }
+
++#ifdef USE_SKIA
++ bool drawPaintTimes = gfxPrefs::AlwaysPaint();
+ if (drawPaintTimes) {
+ DrawPaintTimes(mCompositor);
+ }
++#endif
+ }
+
+ RefPtr<CompositingRenderTarget>
+diff -up firefox-51.0/gfx/layers/composite/LayerManagerComposite.h.1319374 firefox-51.0/gfx/layers/composite/LayerManagerComposite.h
+--- firefox-51.0/gfx/layers/composite/LayerManagerComposite.h.1319374 2017-01-16 17:16:50.000000000 +0100
++++ firefox-51.0/gfx/layers/composite/LayerManagerComposite.h 2017-01-20 09:32:15.040916556 +0100
+@@ -331,11 +331,6 @@ private:
+ #endif
+
+ /**
+- * Render paint and composite times above the frame.
+- */
+- void DrawPaintTimes(Compositor* aCompositor);
+-
+- /**
+ * We need to know our invalid region before we're ready to render.
+ */
+ void InvalidateDebugOverlay(nsIntRegion& aInvalidRegion, const gfx::IntRect& aBounds);
+@@ -391,9 +386,16 @@ private:
+ bool mLastFrameMissedHWC;
+
+ bool mWindowOverlayChanged;
+- RefPtr<PaintCounter> mPaintCounter;
+ TimeDuration mLastPaintTime;
+ TimeStamp mRenderStartTime;
++
++#ifdef USE_SKIA
++ /**
++ * Render paint and composite times above the frame.
++ */
++ void DrawPaintTimes(Compositor* aCompositor);
++ RefPtr<PaintCounter> mPaintCounter;
++#endif
+ };
+
+ /**
+diff -up firefox-51.0/gfx/layers/moz.build.1319374 firefox-51.0/gfx/layers/moz.build
+--- firefox-51.0/gfx/layers/moz.build.1319374 2017-01-16 17:16:50.000000000 +0100
++++ firefox-51.0/gfx/layers/moz.build 2017-01-20 09:31:13.328322116 +0100
+@@ -340,7 +340,6 @@ UNIFIED_SOURCES += [
+ 'composite/ImageHost.cpp',
+ 'composite/ImageLayerComposite.cpp',
+ 'composite/LayerManagerComposite.cpp',
+- 'composite/PaintCounter.cpp',
+ 'composite/PaintedLayerComposite.cpp',
+ 'composite/TextRenderer.cpp',
+ 'composite/TextureHost.cpp',
+@@ -485,3 +484,8 @@ LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'
+
+ if CONFIG['GNU_CXX']:
+ CXXFLAGS += ['-Wno-error=shadow']
++
++if CONFIG['MOZ_ENABLE_SKIA']:
++ UNIFIED_SOURCES += [
++ 'composite/PaintCounter.cpp',
++ ]
bgstack15