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 12:17:56.589954310 +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 12:27:01.818193768 +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 @@ -72,6 +71,9 @@ #include "TextRenderer.h" // for TextRenderer #include "mozilla/layers/CompositorBridgeParent.h" #include "TreeTraversal.h" // for ForEachNode +#ifdef USE_SKIA +#include "PaintCounter.h" // For PaintCounter +#endif class gfxContext; @@ -133,6 +135,10 @@ LayerManagerComposite::LayerManagerCompo { mTextRenderer = new TextRenderer(aCompositor); MOZ_ASSERT(aCompositor); + +#ifdef USE_SKIA + mPaintCounter = nullptr; +#endif } LayerManagerComposite::~LayerManagerComposite() @@ -151,8 +157,11 @@ LayerManagerComposite::Destroy() } mRoot = nullptr; mClonedLayerTreeProperties = nullptr; - mPaintCounter = nullptr; mDestroyed = true; + +#ifdef USE_SKIA + mPaintCounter = nullptr; +#endif } } @@ -564,7 +573,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 +580,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 +600,7 @@ LayerManagerComposite::DrawPaintTimes(Co TimeDuration compositeTime = TimeStamp::Now() - mRenderStartTime; mPaintCounter->Draw(aCompositor, mLastPaintTime, compositeTime); } +#endif static uint16_t sFrameCount = 0; void @@ -595,7 +609,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 +749,12 @@ LayerManagerComposite::RenderDebugOverla sFrameCount++; } +#ifdef USE_SKIA + bool drawPaintTimes = gfxPrefs::AlwaysPaint(); if (drawPaintTimes) { DrawPaintTimes(mCompositor); } +#endif } RefPtr 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 12:17:56.589954310 +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 mPaintCounter; TimeDuration mLastPaintTime; TimeStamp mRenderStartTime; + +#ifdef USE_SKIA + /** + * Render paint and composite times above the frame. + */ + void DrawPaintTimes(Compositor* aCompositor); + RefPtr 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 12:17:56.589954310 +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', + ]