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

Side by Side Diff: src/core/SkPictureRecorder.cpp

Issue 748803005: SkPicture::SnapshotArray doesn't really stand to benefit from refcounting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPicture.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkData.h" 8 #include "SkData.h"
9 #include "SkLayerInfo.h" 9 #include "SkLayerInfo.h"
10 #include "SkPictureRecorder.h" 10 #include "SkPictureRecorder.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 if (saveLayerData) { 54 if (saveLayerData) {
55 SkRecordComputeLayers(fCullRect, *fRecord, fBBH.get(), saveLayerData ); 55 SkRecordComputeLayers(fCullRect, *fRecord, fBBH.get(), saveLayerData );
56 } else { 56 } else {
57 SkRecordFillBounds(fCullRect, *fRecord, fBBH.get()); 57 SkRecordFillBounds(fCullRect, *fRecord, fBBH.get());
58 } 58 }
59 } 59 }
60 60
61 // TODO: we should remember these from our caller 61 // TODO: we should remember these from our caller
62 SkBBHFactory* factory = NULL; 62 SkBBHFactory* factory = NULL;
63 uint32_t recordFlags = 0; 63 uint32_t recordFlags = 0;
64 SkAutoTUnref<SkPicture::SnapshotArray> drawablePicts( 64 SkAutoTDelete<SkPicture::SnapshotArray> drawablePicts(
65 fRecorder->newDrawableSnapshot(factory, recordFlags)); 65 fRecorder->newDrawableSnapshot(factory, recordFlags));
66 SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord.detach(), 66 SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord.detach(),
67 drawablePicts.detach(), fBBH.get()) ); 67 drawablePicts.detach(), fBBH.get()) );
68 68
69 if (saveLayerData) { 69 if (saveLayerData) {
70 pict->EXPERIMENTAL_addAccelData(saveLayerData); 70 pict->EXPERIMENTAL_addAccelData(saveLayerData);
71 } 71 }
72 72
73 return pict; 73 return pict;
74 } 74 }
75 75
76 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const { 76 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const {
77 if (NULL == canvas) { 77 if (NULL == canvas) {
78 return; 78 return;
79 } 79 }
80 80
81 int drawableCount = 0; 81 int drawableCount = 0;
82 SkRecordDraw(*fRecord, canvas, NULL, drawableCount, NULL/*bbh*/, NULL/*callb ack*/); 82 SkRecordDraw(*fRecord, canvas, NULL, drawableCount, NULL/*bbh*/, NULL/*callb ack*/);
83 } 83 }
OLDNEW
« no previous file with comments | « src/core/SkPicture.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698