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

Unified Diff: src/core/SkPictureRecord.cpp

Issue 186813003: Refactor method used to disable peephole optimizations (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 10 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 | « src/core/SkPictureRecord.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 13655)
+++ src/core/SkPictureRecord.cpp (working copy)
@@ -34,7 +34,8 @@
, fStateTree(NULL)
, fFlattenableHeap(HEAP_BLOCK_SIZE)
, fPaints(&fFlattenableHeap)
- , fRecordFlags(flags) {
+ , fRecordFlags(flags)
+ , fOptsEnabled(true) {
#ifdef SK_DEBUG_SIZE
fPointBytes = fRectBytes = fTextBytes = 0;
fPointWrites = fRectWrites = fTextWrites = 0;
@@ -627,7 +628,7 @@
}
size_t opt = 0;
- if (!(fRecordFlags & SkPicture::kDisableRecordOptimizations_RecordingFlag)) {
+ if (fOptsEnabled) {
for (opt = 0; opt < SK_ARRAY_COUNT(gPictureRecordOpts); ++opt) {
if (0 != (gPictureRecordOpts[opt].fFlags & kSkipIfBBoxHierarchy_Flag)
&& NULL != fBoundingHierarchy) {
@@ -642,8 +643,7 @@
}
}
- if ((fRecordFlags & SkPicture::kDisableRecordOptimizations_RecordingFlag) ||
- SK_ARRAY_COUNT(gPictureRecordOpts) == opt) {
+ if (!fOptsEnabled || SK_ARRAY_COUNT(gPictureRecordOpts) == opt) {
// No optimization fired so add the RESTORE
this->recordRestore();
}
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698