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

Side by Side Diff: src/utils/SkNoSaveLayerCanvas.h

Issue 183453002: add new onClip* methods to SkCanvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: remove debug 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 | « src/utils/SkNWayCanvas.cpp ('k') | src/utils/SkProxyCanvas.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 #ifndef SkNoSaveLayerCanvas_DEFINED 8 #ifndef SkNoSaveLayerCanvas_DEFINED
9 #define SkNoSaveLayerCanvas_DEFINED 9 #define SkNoSaveLayerCanvas_DEFINED
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 // Like SkPictureRecord, we don't want to create layers, but we do need 26 // Like SkPictureRecord, we don't want to create layers, but we do need
27 // to respect the save and (possibly) its rect-clip. 27 // to respect the save and (possibly) its rect-clip.
28 int count = this->INHERITED::save(flags); 28 int count = this->INHERITED::save(flags);
29 if (NULL != bounds) { 29 if (NULL != bounds) {
30 this->INHERITED::clipRectBounds(bounds, flags, NULL); 30 this->INHERITED::clipRectBounds(bounds, flags, NULL);
31 } 31 }
32 return count; 32 return count;
33 } 33 }
34 34
35 protected:
35 // disable aa for speed 36 // disable aa for speed
36 virtual bool clipRect(const SkRect& rect, 37 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle) SK_OVERRIDE {
37 SkRegion::Op op, 38 this->INHERITED::onClipRect(rect, op, kHard_ClipEdgeStyle);
38 bool doAA) SK_OVERRIDE {
39 return this->INHERITED::clipRect(rect, op, false);
40 } 39 }
41 40
42 // for speed, just respect the bounds, and disable AA. May give us a few 41 // for speed, just respect the bounds, and disable AA. May give us a few
43 // false positives and negatives. 42 // false positives and negatives.
44 virtual bool clipPath(const SkPath& path, 43 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle) SK_OVERRIDE {
45 SkRegion::Op op, 44 this->updateClipConservativelyUsingBounds(path.getBounds(), op,
46 bool doAA) SK_OVERRIDE { 45 path.isInverseFillType());
47 return this->updateClipConservativelyUsingBounds(path.getBounds(), op,
48 path.isInverseFillType( ));
49 } 46 }
50 virtual bool clipRRect(const SkRRect& rrect, 47 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e) SK_OVERRIDE {
51 SkRegion::Op op, 48 this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
52 bool doAA) SK_OVERRIDE {
53 return this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
54 } 49 }
55 50
56 private: 51 private:
57 typedef SkCanvas INHERITED; 52 typedef SkCanvas INHERITED;
58 }; 53 };
59 54
60 #endif // SkNoSaveLayerCanvas_DEFINED 55 #endif // SkNoSaveLayerCanvas_DEFINED
OLDNEW
« no previous file with comments | « src/utils/SkNWayCanvas.cpp ('k') | src/utils/SkProxyCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698