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

Unified Diff: src/core/SkPicture.cpp

Issue 238273012: Staged removal of SkPicture-derived classes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: have SkPicture only friend SkPictureRecorder once 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 | « samplecode/SampleTiling.cpp ('k') | src/core/SkQuadTreePicture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicture.cpp
===================================================================
--- src/core/SkPicture.cpp (revision 14237)
+++ src/core/SkPicture.cpp (working copy)
@@ -222,6 +222,8 @@
///////////////////////////////////////////////////////////////////////////////
+#ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES
+
SkCanvas* SkPicture::beginRecording(int width, int height,
uint32_t recordingFlags) {
if (fPlayback) {
@@ -252,6 +254,43 @@
return fRecord;
}
+#endif
+
+SkCanvas* SkPicture::beginRecording(int width, int height,
+ SkBBHFactory* bbhFactory,
+ uint32_t recordingFlags) {
+ if (fPlayback) {
+ SkDELETE(fPlayback);
+ fPlayback = NULL;
+ }
+ SkSafeUnref(fAccelData);
+ SkSafeSetNull(fRecord);
+
+ this->needsNewGenID();
+
+ fWidth = width;
+ fHeight = height;
+
+ const SkISize size = SkISize::Make(width, height);
+
+ if (NULL != bbhFactory) {
+ SkAutoTUnref<SkBBoxHierarchy> tree((*bbhFactory)(width, height));
+ SkASSERT(NULL != tree);
+ fRecord = SkNEW_ARGS(SkBBoxHierarchyRecord, (size,
+ recordingFlags|
+ kOptimizeForClippedPlayback_RecordingFlag,
+ tree.get()));
+ } else {
+ fRecord = SkNEW_ARGS(SkPictureRecord, (size, recordingFlags));
+ }
+ fRecord->beginRecording();
+
+ return fRecord;
+}
+
+
+#ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES
+
SkBBoxHierarchy* SkPicture::createBBoxHierarchy() const {
// TODO: this code is now replicated in SkRTreePicture. Once all external
// clients have been weaned off of kOptimizeForClippedPlayback_RecordingFlag,
@@ -270,6 +309,8 @@
aspectRatio, sortDraws);
}
+#endif
+
SkCanvas* SkPicture::getRecordingCanvas() const {
// will be null if we are not recording
return fRecord;
« no previous file with comments | « samplecode/SampleTiling.cpp ('k') | src/core/SkQuadTreePicture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698