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

Unified Diff: tools/PictureRenderer.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 | « tools/PictureRenderer.h ('k') | tools/PictureRenderingFlags.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/PictureRenderer.cpp
===================================================================
--- tools/PictureRenderer.cpp (revision 14237)
+++ tools/PictureRenderer.cpp (working copy)
@@ -274,9 +274,10 @@
void PictureRenderer::buildBBoxHierarchy() {
SkASSERT(NULL != fPicture);
if (kNone_BBoxHierarchyType != fBBoxHierarchyType && NULL != fPicture) {
- SkAutoTUnref<SkPictureFactory> factory(this->getFactory());
- SkPictureRecorder recorder(factory);
+ SkAutoTDelete<SkBBHFactory> factory(this->getFactory());
+ SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(fPicture->width(), fPicture->height(),
+ factory.get(),
this->recordFlags());
fPicture->draw(canvas);
fPicture.reset(recorder.endRecording());
@@ -435,9 +436,10 @@
}
bool RecordPictureRenderer::render(SkBitmap** out) {
- SkAutoTUnref<SkPictureFactory> factory(this->getFactory());
- SkPictureRecorder recorder(factory);
+ SkAutoTDelete<SkBBHFactory> factory(this->getFactory());
+ SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(this->getViewWidth(), this->getViewHeight(),
+ factory.get(),
this->recordFlags());
this->scaleToScaleFactor(canvas);
fPicture->draw(canvas);
@@ -954,9 +956,10 @@
///////////////////////////////////////////////////////////////////////////////////////////////
void PlaybackCreationRenderer::setup() {
- SkAutoTUnref<SkPictureFactory> factory(this->getFactory());
- fRecorder.reset(SkNEW_ARGS(SkPictureRecorder, (factory)));
+ SkAutoTDelete<SkBBHFactory> factory(this->getFactory());
+ fRecorder.reset(SkNEW(SkPictureRecorder));
SkCanvas* canvas = fRecorder->beginRecording(this->getViewWidth(), this->getViewHeight(),
+ factory.get(),
this->recordFlags());
this->scaleToScaleFactor(canvas);
canvas->drawPicture(*fPicture);
@@ -975,16 +978,16 @@
///////////////////////////////////////////////////////////////////////////////////////////////
// SkPicture variants for each BBoxHierarchy type
-SkPictureFactory* PictureRenderer::getFactory() {
+SkBBHFactory* PictureRenderer::getFactory() {
switch (fBBoxHierarchyType) {
case kNone_BBoxHierarchyType:
return NULL;
case kQuadTree_BBoxHierarchyType:
- return SkNEW(SkQuadTreePictureFactory);
+ return SkNEW(SkQuadTreeFactory);
case kRTree_BBoxHierarchyType:
- return SkNEW(SkRTreePictureFactory);
+ return SkNEW(SkRTreeFactory);
case kTileGrid_BBoxHierarchyType:
- return new SkTileGridPictureFactory(fGridInfo);
+ return SkNEW_ARGS(SkTileGridFactory, (fGridInfo));
}
SkASSERT(0); // invalid bbhType
return NULL;
« no previous file with comments | « tools/PictureRenderer.h ('k') | tools/PictureRenderingFlags.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698