Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h

Issue 2210123002: Improved heuristic for disable acceleration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BaseRenderingContext2D_h 5 #ifndef BaseRenderingContext2D_h
6 #define BaseRenderingContext2D_h 6 #define BaseRenderingContext2D_h
7 7
8 #include "bindings/modules/v8/HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElem entOrImageBitmap.h" 8 #include "bindings/modules/v8/HTMLImageElementOrHTMLVideoElementOrHTMLCanvasElem entOrImageBitmap.h"
9 #include "bindings/modules/v8/StringOrCanvasGradientOrCanvasPattern.h" 9 #include "bindings/modules/v8/StringOrCanvasGradientOrCanvasPattern.h"
10 #include "core/html/ImageData.h" 10 #include "core/html/ImageData.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 virtual bool isContextLost() const = 0; 159 virtual bool isContextLost() const = 0;
160 160
161 void restoreMatrixClipStack(SkCanvas*) const; 161 void restoreMatrixClipStack(SkCanvas*) const;
162 162
163 DECLARE_VIRTUAL_TRACE(); 163 DECLARE_VIRTUAL_TRACE();
164 164
165 enum DrawCallType { 165 enum DrawCallType {
166 StrokePath = 0, 166 StrokePath = 0,
167 FillPath, 167 FillPath,
168 DrawImage, 168 DrawSVGImage,
Justin Novosad 2016/08/04 15:53:17 SVG -> Vector
sebastienlc 2016/08/04 16:36:27 Done.
169 DrawPNGImage,
Justin Novosad 2016/08/04 15:53:17 PNG -> Bitmap
sebastienlc 2016/08/04 16:36:27 Done.
169 FillText, 170 FillText,
170 StrokeText, 171 StrokeText,
171 FillRect, 172 FillRect,
172 StrokeRect, 173 StrokeRect,
173 DrawCallTypeCount // used to specify the size of storage arrays 174 DrawCallTypeCount // used to specify the size of storage arrays
174 }; 175 };
175 176
176 enum PathFillType { 177 enum PathFillType {
177 ColorFillType, 178 ColorFillType,
178 LinearGradientFillType, 179 LinearGradientFillType,
179 RadialGradientFillType, 180 RadialGradientFillType,
180 PatternFillType, 181 PatternFillType,
181 PathFillTypeCount // used to specify the size of storage arrays 182 PathFillTypeCount // used to specify the size of storage arrays
182 }; 183 };
183 184
184 struct UsageCounters { 185 struct UsageCounters {
185 int numDrawCalls[DrawCallTypeCount]; // use DrawCallType enum as index 186 int numDrawCalls[DrawCallTypeCount]; // use DrawCallType enum as index
186 double boundingBoxPerimeterDrawCalls[DrawCallTypeCount]; 187 double boundingBoxPerimeterDrawCalls[DrawCallTypeCount];
187 double boundingBoxAreaDrawCalls[DrawCallTypeCount]; 188 double boundingBoxAreaDrawCalls[DrawCallTypeCount];
188 double boundingBoxAreaFillType[PathFillTypeCount]; 189 double boundingBoxAreaFillType[PathFillTypeCount];
189 int numNonConvexFillPathCalls; 190 int numNonConvexFillPathCalls;
190 int numGradients; 191 double nonConvexFillPathArea;
Justin Novosad 2016/08/04 15:53:17 Could you change all these doubles to float. The
sebastienlc 2016/08/04 16:36:27 Done.
192 int numRadialGradients;
193 int numLinearGradients;
191 int numPatterns; 194 int numPatterns;
192 int numDrawWithComplexClips; 195 int numDrawWithComplexClips;
193 int numBlurredShadows; 196 int numBlurredShadows;
194 double boundingBoxAreaTimesShadowBlurSquared; 197 double boundingBoxAreaTimesShadowBlurSquared;
195 double boundingBoxPerimeterTimesShadowBlurSquared; 198 double boundingBoxPerimeterTimesShadowBlurSquared;
196 int numFilters; 199 int numFilters;
197 int numGetImageDataCalls; 200 int numGetImageDataCalls;
198 double areaGetImageDataCalls; 201 double areaGetImageDataCalls;
199 int numPutImageDataCalls; 202 int numPutImageDataCalls;
200 double areaPutImageDataCalls; 203 double areaPutImageDataCalls;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 foregroundPaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); 339 foregroundPaint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
337 c->setMatrix(ctm); 340 c->setMatrix(ctm);
338 drawFunc(c, &foregroundPaint); 341 drawFunc(c, &foregroundPaint);
339 c->restore(); 342 c->restore();
340 c->setMatrix(ctm); 343 c->setMatrix(ctm);
341 } 344 }
342 345
343 } // namespace blink 346 } // namespace blink
344 347
345 #endif // BaseRenderingContext2D_h 348 #endif // BaseRenderingContext2D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698