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

Unified Diff: src/core/SkPictureRecord.cpp

Issue 12843028: Add testing of optimizations to GM (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: compiler warning/error fixes Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPicture.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecord.cpp
===================================================================
--- src/core/SkPictureRecord.cpp (revision 8655)
+++ src/core/SkPictureRecord.cpp (working copy)
@@ -412,7 +412,7 @@
/*
* Restore has just been called (but not recorded), look back at the
* matching save* and see if we are in the configuration:
- * SAVE_LAYER
+ * SAVE_LAYER (with NULL == bounds)
* SAVE
* CLIP_RECT
* DRAW_BITMAP|DRAW_BITMAP_MATRIX|DRAW_BITMAP_NINE|DRAW_BITMAP_RECT_TO_RECT
@@ -565,18 +565,21 @@
uint32_t initialOffset, size;
size_t opt;
- for (opt = 0; opt < SK_ARRAY_COUNT(gPictureRecordOpts); ++opt) {
- if ((*gPictureRecordOpts[opt].fProc)(&fWriter, fRestoreOffsetStack.top(), &fPaints)) {
- // Some optimization fired so don't add the RESTORE
- size = 0;
- initialOffset = fWriter.size();
- apply_optimization_to_bbh(gPictureRecordOpts[opt].fType,
- fStateTree, fBoundingHierarchy);
- break;
+ if (!(fRecordFlags & SkPicture::kDisableRecordOptimizations_RecordingFlag)) {
+ for (opt = 0; opt < SK_ARRAY_COUNT(gPictureRecordOpts); ++opt) {
+ if ((*gPictureRecordOpts[opt].fProc)(&fWriter, fRestoreOffsetStack.top(), &fPaints)) {
+ // Some optimization fired so don't add the RESTORE
+ size = 0;
+ initialOffset = fWriter.size();
+ apply_optimization_to_bbh(gPictureRecordOpts[opt].fType,
+ fStateTree, fBoundingHierarchy);
+ break;
+ }
}
- }
+ }
- if (SK_ARRAY_COUNT(gPictureRecordOpts) == opt) {
+ if ((fRecordFlags & SkPicture::kDisableRecordOptimizations_RecordingFlag) ||
+ SK_ARRAY_COUNT(gPictureRecordOpts) == opt) {
// No optimization fired so add the RESTORE
fillRestoreOffsetPlaceholdersForCurrentStackLevel((uint32_t)fWriter.size());
size = 1 * kUInt32Size; // RESTORE consists solely of 1 op code
« no previous file with comments | « include/core/SkPicture.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698