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

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

Issue 541593005: allow canvas to force conservative clips (for speed) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkDeviceLooper.h" 8 #include "SkDeviceLooper.h"
9 9
10 SkDeviceLooper::SkDeviceLooper(const SkBitmap& base, 10 SkDeviceLooper::SkDeviceLooper(const SkBitmap& base,
11 const SkRasterClip& rc, 11 const SkRasterClip& rc,
12 const SkIRect& bounds, bool aa) 12 const SkIRect& bounds, bool aa)
13 : fBaseBitmap(base) 13 : fBaseBitmap(base)
14 , fBaseRC(rc) 14 , fBaseRC(rc)
15 , fDelta(aa ? kAA_Delta : kBW_Delta) 15 , fSubsetRC(rc.isForceConservativeRects())
16 , fDelta(aa ? kAA_Delta : kBW_Delta)
16 { 17 {
17 // sentinels that next() has not yet been called, and so our mapper function s 18 // sentinels that next() has not yet been called, and so our mapper function s
18 // should not be called either. 19 // should not be called either.
19 fCurrBitmap = NULL; 20 fCurrBitmap = NULL;
20 fCurrRC = NULL; 21 fCurrRC = NULL;
21 22
22 if (!rc.isEmpty()) { 23 if (!rc.isEmpty()) {
23 // clip must be contained by the bitmap 24 // clip must be contained by the bitmap
24 SkASSERT(SkIRect::MakeWH(base.width(), base.height()).contains(rc.getBou nds())); 25 SkASSERT(SkIRect::MakeWH(base.width(), base.height()).contains(rc.getBou nds()));
25 } 26 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 while (next_tile(fClippedBounds, fDelta, &fCurrOffset)) { 123 while (next_tile(fClippedBounds, fDelta, &fCurrOffset)) {
123 if (this->computeCurrBitmapAndClip()) { 124 if (this->computeCurrBitmapAndClip()) {
124 return true; 125 return true;
125 } 126 }
126 } 127 }
127 break; 128 break;
128 } 129 }
129 fState = kDone_State; 130 fState = kDone_State;
130 return false; 131 return false;
131 } 132 }
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | src/core/SkRasterClip.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698