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

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

Issue 1178673007: Allow reset of the SkPictureRecorder cull rect before endRecording. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Removed bbhFactory Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | tests/PictureTest.cpp » ('j') | 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 "SkBigPicture.h" 8 #include "SkBigPicture.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkDrawable.h" 10 #include "SkDrawable.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 subPictureBytes += SkPictureUtils::ApproximateBytesUsed(pictList->begin( )[i]); 88 subPictureBytes += SkPictureUtils::ApproximateBytesUsed(pictList->begin( )[i]);
89 } 89 }
90 return SkNEW_ARGS(SkBigPicture, (fCullRect, 90 return SkNEW_ARGS(SkBigPicture, (fCullRect,
91 fRecord.detach(), 91 fRecord.detach(),
92 pictList, 92 pictList,
93 fBBH.detach(), 93 fBBH.detach(),
94 saveLayerData.detach(), 94 saveLayerData.detach(),
95 subPictureBytes)); 95 subPictureBytes));
96 } 96 }
97 97
98 SkPicture* SkPictureRecorder::endRecordingAsPicture(const SkRect& cullRect) {
99 fCullRect = cullRect;
100 return this->endRecordingAsPicture();
101 }
102
103
98 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const { 104 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const {
99 if (NULL == canvas) { 105 if (NULL == canvas) {
100 return; 106 return;
101 } 107 }
102 108
103 int drawableCount = 0; 109 int drawableCount = 0;
104 SkDrawable* const* drawables = NULL; 110 SkDrawable* const* drawables = NULL;
105 SkDrawableList* drawableList = fRecorder->getDrawableList(); 111 SkDrawableList* drawableList = fRecorder->getDrawableList();
106 if (drawableList) { 112 if (drawableList) {
107 drawableCount = drawableList->count(); 113 drawableCount = drawableList->count();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 (fRecord, fBBH, fRecorder->detachDrawabl eList(), 198 (fRecord, fBBH, fRecorder->detachDrawabl eList(),
193 fCullRect, 199 fCullRect,
194 SkToBool(fFlags & kComputeSaveLayerInfo _RecordFlag))); 200 SkToBool(fFlags & kComputeSaveLayerInfo _RecordFlag)));
195 201
196 // release our refs now, so only the drawable will be the owner. 202 // release our refs now, so only the drawable will be the owner.
197 fRecord.reset(NULL); 203 fRecord.reset(NULL);
198 fBBH.reset(NULL); 204 fBBH.reset(NULL);
199 205
200 return drawable; 206 return drawable;
201 } 207 }
OLDNEW
« no previous file with comments | « include/core/SkPictureRecorder.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698