summaryrefslogtreecommitdiff
path: root/mozilla-1319374.patch
blob: 33a0944a9283e6571fb86bfc4e82b36106ce7f63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
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