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

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

Issue 138013009: Culling API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Assert nested culls. 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
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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 bool SkAutoROCanvasPixels::asROBitmap(SkBitmap* bitmap) const { 986 bool SkAutoROCanvasPixels::asROBitmap(SkBitmap* bitmap) const {
986 if (fAddr) { 987 if (fAddr) {
987 return bitmap->installPixels(fInfo, const_cast<void*>(fAddr), fRowBytes, 988 return bitmap->installPixels(fInfo, const_cast<void*>(fAddr), fRowBytes,
988 NULL, NULL); 989 NULL, NULL);
989 } else { 990 } else {
990 bitmap->reset(); 991 bitmap->reset();
991 return false; 992 return false;
992 } 993 }
993 } 994 }
994 995
996 void SkCanvas::onPushCull(const SkRect& cullRect) {
997 // do nothing. Subclasses may do something
998 }
999
1000 void SkCanvas::onPopCull() {
1001 // do nothing. Subclasses may do something
1002 }
1003
995 ///////////////////////////////////////////////////////////////////////////// 1004 /////////////////////////////////////////////////////////////////////////////
996 1005
997 void SkCanvas::internalDrawBitmap(const SkBitmap& bitmap, 1006 void SkCanvas::internalDrawBitmap(const SkBitmap& bitmap,
998 const SkMatrix& matrix, const SkPaint* paint) { 1007 const SkMatrix& matrix, const SkPaint* paint) {
999 if (bitmap.drawsNothing()) { 1008 if (bitmap.drawsNothing()) {
1000 return; 1009 return;
1001 } 1010 }
1002 1011
1003 SkLazyPaint lazy; 1012 SkLazyPaint lazy;
1004 if (NULL == paint) { 1013 if (NULL == paint) {
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2288 return *paint; 2297 return *paint;
2289 } 2298 }
2290 2299
2291 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } 2300 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); }
2292 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } 2301 int SkCanvas::LayerIter::x() const { return fImpl->getX(); }
2293 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } 2302 int SkCanvas::LayerIter::y() const { return fImpl->getY(); }
2294 2303
2295 /////////////////////////////////////////////////////////////////////////////// 2304 ///////////////////////////////////////////////////////////////////////////////
2296 2305
2297 SkCanvas::ClipVisitor::~ClipVisitor() { } 2306 SkCanvas::ClipVisitor::~ClipVisitor() { }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698