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

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

Issue 138013009: Culling API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Updated per comments. Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « include/utils/SkDumpCanvas.h ('k') | src/core/SkPictureFlat.h » ('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 2008 The Android Open Source Project 3 * Copyright 2008 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 "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 //////////////////////////////////////////////////////////////////////////// 483 ////////////////////////////////////////////////////////////////////////////
484 484
485 SkBaseDevice* SkCanvas::init(SkBaseDevice* device) { 485 SkBaseDevice* SkCanvas::init(SkBaseDevice* device) {
486 fBounder = NULL; 486 fBounder = NULL;
487 fCachedLocalClipBounds.setEmpty(); 487 fCachedLocalClipBounds.setEmpty();
488 fCachedLocalClipBoundsDirty = true; 488 fCachedLocalClipBoundsDirty = true;
489 fAllowSoftClip = true; 489 fAllowSoftClip = true;
490 fAllowSimplifyClip = false; 490 fAllowSimplifyClip = false;
491 fDeviceCMDirty = false; 491 fDeviceCMDirty = false;
492 fSaveLayerCount = 0; 492 fSaveLayerCount = 0;
493 fCullCount = 0;
493 fMetaData = NULL; 494 fMetaData = NULL;
494 495
495 fMCRec = (MCRec*)fMCStack.push_back(); 496 fMCRec = (MCRec*)fMCStack.push_back();
496 new (fMCRec) MCRec(NULL, 0); 497 new (fMCRec) MCRec(NULL, 0);
497 498
498 fMCRec->fLayer = SkNEW_ARGS(DeviceCM, (NULL, 0, 0, NULL, NULL)); 499 fMCRec->fLayer = SkNEW_ARGS(DeviceCM, (NULL, 0, 0, NULL, NULL));
499 fMCRec->fTopLayer = fMCRec->fLayer; 500 fMCRec->fTopLayer = fMCRec->fLayer;
500 fMCRec->fNext = NULL; 501 fMCRec->fNext = NULL;
501 502
502 fSurfaceBase = NULL; 503 fSurfaceBase = NULL;
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 bool SkAutoROCanvasPixels::asROBitmap(SkBitmap* bitmap) const { 996 bool SkAutoROCanvasPixels::asROBitmap(SkBitmap* bitmap) const {
996 if (fAddr) { 997 if (fAddr) {
997 return bitmap->installPixels(fInfo, const_cast<void*>(fAddr), fRowBytes, 998 return bitmap->installPixels(fInfo, const_cast<void*>(fAddr), fRowBytes,
998 NULL, NULL); 999 NULL, NULL);
999 } else { 1000 } else {
1000 bitmap->reset(); 1001 bitmap->reset();
1001 return false; 1002 return false;
1002 } 1003 }
1003 } 1004 }
1004 1005
1006 void SkCanvas::onPushCull(const SkRect& cullRect) {
1007 // do nothing. Subclasses may do something
1008 }
1009
1010 void SkCanvas::onPopCull() {
1011 // do nothing. Subclasses may do something
1012 }
1013
1005 ///////////////////////////////////////////////////////////////////////////// 1014 /////////////////////////////////////////////////////////////////////////////
1006 1015
1007 void SkCanvas::internalDrawBitmap(const SkBitmap& bitmap, 1016 void SkCanvas::internalDrawBitmap(const SkBitmap& bitmap,
1008 const SkMatrix& matrix, const SkPaint* paint) { 1017 const SkMatrix& matrix, const SkPaint* paint) {
1009 if (bitmap.drawsNothing()) { 1018 if (bitmap.drawsNothing()) {
1010 return; 1019 return;
1011 } 1020 }
1012 1021
1013 SkLazyPaint lazy; 1022 SkLazyPaint lazy;
1014 if (NULL == paint) { 1023 if (NULL == paint) {
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 return *paint; 2307 return *paint;
2299 } 2308 }
2300 2309
2301 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } 2310 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); }
2302 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } 2311 int SkCanvas::LayerIter::x() const { return fImpl->getX(); }
2303 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } 2312 int SkCanvas::LayerIter::y() const { return fImpl->getY(); }
2304 2313
2305 /////////////////////////////////////////////////////////////////////////////// 2314 ///////////////////////////////////////////////////////////////////////////////
2306 2315
2307 SkCanvas::ClipVisitor::~ClipVisitor() { } 2316 SkCanvas::ClipVisitor::~ClipVisitor() { }
OLDNEW
« no previous file with comments | « include/utils/SkDumpCanvas.h ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698