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

Unified Diff: src/record/SkRecordCulling.cpp

Issue 243243003: anticipate more optimizations by renaming some files and methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « src/record/SkRecordCulling.h ('k') | src/record/SkRecordOpts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/record/SkRecordCulling.cpp
diff --git a/src/record/SkRecordCulling.cpp b/src/record/SkRecordCulling.cpp
deleted file mode 100644
index f147ee668353497dac00811bdf5d70a870a3c2e7..0000000000000000000000000000000000000000
--- a/src/record/SkRecordCulling.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkRecordCulling.h"
-
-#include "SkRecords.h"
-#include "SkTDArray.h"
-
-namespace {
-
-struct Annotator {
- unsigned index;
- SkTDArray<SkRecords::PushCull*> pushStack;
-
- // Do nothing to most record types.
- template <typename T> void operator()(T*) {}
-};
-
-template <> void Annotator::operator()(SkRecords::PushCull* push) {
- // Store the push's index for now. We'll calculate the offset using this in the paired pop.
- push->popOffset = index;
- pushStack.push(push);
-}
-
-template <> void Annotator::operator()(SkRecords::PopCull* pop) {
- SkRecords::PushCull* push = pushStack.top();
- pushStack.pop();
-
- SkASSERT(index > push->popOffset); // push->popOffset holds the index of the push.
- push->popOffset = index - push->popOffset; // Now it's the offset between push and pop.
-}
-
-} // namespace
-
-void SkRecordAnnotateCullingPairs(SkRecord* record) {
- Annotator annotator;
-
- for (annotator.index = 0; annotator.index < record->count(); annotator.index++) {
- record->mutate(annotator.index, annotator);
- }
-}
« no previous file with comments | « src/record/SkRecordCulling.h ('k') | src/record/SkRecordOpts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698