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

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

Issue 485703002: Counterproposal for skirting the BBH when the query fully contains the picture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: explain Created 6 years, 4 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 | « no previous file | src/core/SkRecordDraw.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 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkPictureFlat.h" 10 #include "SkPictureFlat.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 return fData->getActiveOps(queryRect); 190 return fData->getActiveOps(queryRect);
191 } 191 }
192 return NULL; 192 return NULL;
193 } 193 }
194 194
195 // fRecord OK 195 // fRecord OK
196 void SkPicture::draw(SkCanvas* canvas, SkDrawPictureCallback* callback) const { 196 void SkPicture::draw(SkCanvas* canvas, SkDrawPictureCallback* callback) const {
197 SkASSERT(NULL != canvas); 197 SkASSERT(NULL != canvas);
198 SkASSERT(NULL != fData.get() || NULL != fRecord.get()); 198 SkASSERT(NULL != fData.get() || NULL != fRecord.get());
199 199
200 // If the query contains the whole picture, don't bother with the BBH.
201 SkRect clipBounds = { 0, 0, 0, 0 };
202 (void)canvas->getClipBounds(&clipBounds);
203 const bool useBBH = !clipBounds.contains(SkRect::MakeWH(this->width(), this- >height()));
204
200 if (NULL != fData.get()) { 205 if (NULL != fData.get()) {
201 SkPicturePlayback playback(this); 206 SkPicturePlayback playback(this);
207 playback.setUseBBH(useBBH);
202 playback.draw(canvas, callback); 208 playback.draw(canvas, callback);
203 } 209 }
204 if (NULL != fRecord.get()) { 210 if (NULL != fRecord.get()) {
205 SkRecordDraw(*fRecord, canvas, fBBH.get(), callback); 211 SkRecordDraw(*fRecord, canvas, useBBH ? fBBH.get() : NULL, callback);
206 } 212 }
207 } 213 }
208 214
209 /////////////////////////////////////////////////////////////////////////////// 215 ///////////////////////////////////////////////////////////////////////////////
210 216
211 #include "SkStream.h" 217 #include "SkStream.h"
212 218
213 static const char kMagic[] = { 's', 'k', 'i', 'a', 'p', 'i', 'c', 't' }; 219 static const char kMagic[] = { 's', 'k', 'i', 'a', 'p', 'i', 'c', 't' };
214 220
215 // fRecord OK 221 // fRecord OK
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 int SkPicture::approximateOpCount() const { 466 int SkPicture::approximateOpCount() const {
461 SkASSERT(fRecord.get() || fData.get()); 467 SkASSERT(fRecord.get() || fData.get());
462 if (fRecord.get()) { 468 if (fRecord.get()) {
463 return fRecord->count(); 469 return fRecord->count();
464 } 470 }
465 if (fData.get()) { 471 if (fData.get()) {
466 return fData->opCount(); 472 return fData->opCount();
467 } 473 }
468 return 0; 474 return 0;
469 } 475 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698