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

Side by Side Diff: src/utils/SkDeferredCanvas.cpp

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/SkCanvasStack.cpp ('k') | src/utils/SkDumpCanvas.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 2013 Google Inc. 3 * Copyright 2013 Google Inc.
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 #include "SkDeferredCanvas.h" 9 #include "SkDeferredCanvas.h"
10 10
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 this->recordedDrawCommand(); 782 this->recordedDrawCommand();
783 return val; 783 return val;
784 } 784 }
785 785
786 void SkDeferredCanvas::setMatrix(const SkMatrix& matrix) { 786 void SkDeferredCanvas::setMatrix(const SkMatrix& matrix) {
787 this->drawingCanvas()->setMatrix(matrix); 787 this->drawingCanvas()->setMatrix(matrix);
788 this->INHERITED::setMatrix(matrix); 788 this->INHERITED::setMatrix(matrix);
789 this->recordedDrawCommand(); 789 this->recordedDrawCommand();
790 } 790 }
791 791
792 bool SkDeferredCanvas::clipRect(const SkRect& rect, 792 void SkDeferredCanvas::onClipRect(const SkRect& rect,
793 SkRegion::Op op, 793 SkRegion::Op op,
794 bool doAntiAlias) { 794 ClipEdgeStyle edgeStyle) {
795 this->drawingCanvas()->clipRect(rect, op, doAntiAlias); 795 this->drawingCanvas()->clipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle);
796 bool val = this->INHERITED::clipRect(rect, op, doAntiAlias); 796 this->INHERITED::onClipRect(rect, op, edgeStyle);
797 this->recordedDrawCommand(); 797 this->recordedDrawCommand();
798 return val;
799 } 798 }
800 799
801 bool SkDeferredCanvas::clipRRect(const SkRRect& rrect, 800 void SkDeferredCanvas::onClipRRect(const SkRRect& rrect,
802 SkRegion::Op op, 801 SkRegion::Op op,
803 bool doAntiAlias) { 802 ClipEdgeStyle edgeStyle) {
804 this->drawingCanvas()->clipRRect(rrect, op, doAntiAlias); 803 this->drawingCanvas()->clipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle );
805 bool val = this->INHERITED::clipRRect(rrect, op, doAntiAlias); 804 this->INHERITED::onClipRRect(rrect, op, edgeStyle);
806 this->recordedDrawCommand(); 805 this->recordedDrawCommand();
807 return val;
808 } 806 }
809 807
810 bool SkDeferredCanvas::clipPath(const SkPath& path, 808 void SkDeferredCanvas::onClipPath(const SkPath& path,
811 SkRegion::Op op, 809 SkRegion::Op op,
812 bool doAntiAlias) { 810 ClipEdgeStyle edgeStyle) {
813 this->drawingCanvas()->clipPath(path, op, doAntiAlias); 811 this->drawingCanvas()->clipPath(path, op, kSoft_ClipEdgeStyle == edgeStyle);
814 bool val = this->INHERITED::clipPath(path, op, doAntiAlias); 812 this->INHERITED::onClipPath(path, op, edgeStyle);
815 this->recordedDrawCommand(); 813 this->recordedDrawCommand();
816 return val;
817 } 814 }
818 815
819 bool SkDeferredCanvas::clipRegion(const SkRegion& deviceRgn, 816 void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
820 SkRegion::Op op) {
821 this->drawingCanvas()->clipRegion(deviceRgn, op); 817 this->drawingCanvas()->clipRegion(deviceRgn, op);
822 bool val = this->INHERITED::clipRegion(deviceRgn, op); 818 this->INHERITED::onClipRegion(deviceRgn, op);
823 this->recordedDrawCommand(); 819 this->recordedDrawCommand();
824 return val;
825 } 820 }
826 821
827 void SkDeferredCanvas::clear(SkColor color) { 822 void SkDeferredCanvas::clear(SkColor color) {
828 // purge pending commands 823 // purge pending commands
829 if (fDeferredDrawing) { 824 if (fDeferredDrawing) {
830 this->getDeferredDevice()->skipPendingCommands(); 825 this->getDeferredDevice()->skipPendingCommands();
831 } 826 }
832 827
833 this->drawingCanvas()->clear(color); 828 this->drawingCanvas()->clear(color);
834 this->recordedDrawCommand(); 829 this->recordedDrawCommand();
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { 1016 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
1022 this->drawingCanvas()->setDrawFilter(filter); 1017 this->drawingCanvas()->setDrawFilter(filter);
1023 this->INHERITED::setDrawFilter(filter); 1018 this->INHERITED::setDrawFilter(filter);
1024 this->recordedDrawCommand(); 1019 this->recordedDrawCommand();
1025 return filter; 1020 return filter;
1026 } 1021 }
1027 1022
1028 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { 1023 SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
1029 return this->drawingCanvas(); 1024 return this->drawingCanvas();
1030 } 1025 }
OLDNEW
« no previous file with comments | « src/utils/SkCanvasStack.cpp ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698