summaryrefslogtreecommitdiff
path: root/mozilla-1319374.patch
blob: 1dec744f99df477e168f89205e9d0c7eda1d1d76 (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
165
166
167
168
169
170
171
172
173
174
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<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 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<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 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',
+  ]
bgstack15