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

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

Issue 195793012: De-virtualize SkCanvas matrix ops. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 void SkDeferredCanvas::willRestore() { 757 void SkDeferredCanvas::willRestore() {
758 this->drawingCanvas()->restore(); 758 this->drawingCanvas()->restore();
759 this->recordedDrawCommand(); 759 this->recordedDrawCommand();
760 this->INHERITED::willRestore(); 760 this->INHERITED::willRestore();
761 } 761 }
762 762
763 bool SkDeferredCanvas::isDrawingToLayer() const { 763 bool SkDeferredCanvas::isDrawingToLayer() const {
764 return this->drawingCanvas()->isDrawingToLayer(); 764 return this->drawingCanvas()->isDrawingToLayer();
765 } 765 }
766 766
767 bool SkDeferredCanvas::translate(SkScalar dx, SkScalar dy) { 767 void SkDeferredCanvas::didTranslate(SkScalar dx, SkScalar dy) {
768 this->drawingCanvas()->translate(dx, dy); 768 this->drawingCanvas()->translate(dx, dy);
769 bool val = this->INHERITED::translate(dx, dy);
770 this->recordedDrawCommand(); 769 this->recordedDrawCommand();
771 return val; 770 this->INHERITED::didTranslate(dx, dy);
772 } 771 }
773 772
774 bool SkDeferredCanvas::scale(SkScalar sx, SkScalar sy) { 773 void SkDeferredCanvas::didScale(SkScalar sx, SkScalar sy) {
775 this->drawingCanvas()->scale(sx, sy); 774 this->drawingCanvas()->scale(sx, sy);
776 bool val = this->INHERITED::scale(sx, sy);
777 this->recordedDrawCommand(); 775 this->recordedDrawCommand();
778 return val; 776 this->INHERITED::didScale(sx, sy);
779 } 777 }
780 778
781 bool SkDeferredCanvas::rotate(SkScalar degrees) { 779 void SkDeferredCanvas::didRotate(SkScalar degrees) {
782 this->drawingCanvas()->rotate(degrees); 780 this->drawingCanvas()->rotate(degrees);
783 bool val = this->INHERITED::rotate(degrees);
784 this->recordedDrawCommand(); 781 this->recordedDrawCommand();
785 return val; 782 this->INHERITED::didRotate(degrees);
786 } 783 }
787 784
788 bool SkDeferredCanvas::skew(SkScalar sx, SkScalar sy) { 785 void SkDeferredCanvas::didSkew(SkScalar sx, SkScalar sy) {
789 this->drawingCanvas()->skew(sx, sy); 786 this->drawingCanvas()->skew(sx, sy);
790 bool val = this->INHERITED::skew(sx, sy);
791 this->recordedDrawCommand(); 787 this->recordedDrawCommand();
792 return val; 788 this->INHERITED::didSkew(sx, sy);
793 } 789 }
794 790
795 bool SkDeferredCanvas::concat(const SkMatrix& matrix) { 791 void SkDeferredCanvas::didConcat(const SkMatrix& matrix) {
796 this->drawingCanvas()->concat(matrix); 792 this->drawingCanvas()->concat(matrix);
797 bool val = this->INHERITED::concat(matrix);
798 this->recordedDrawCommand(); 793 this->recordedDrawCommand();
799 return val; 794 this->INHERITED::didConcat(matrix);
800 } 795 }
801 796
802 void SkDeferredCanvas::setMatrix(const SkMatrix& matrix) { 797 void SkDeferredCanvas::didSetMatrix(const SkMatrix& matrix) {
803 this->drawingCanvas()->setMatrix(matrix); 798 this->drawingCanvas()->setMatrix(matrix);
804 this->INHERITED::setMatrix(matrix);
805 this->recordedDrawCommand(); 799 this->recordedDrawCommand();
800 this->INHERITED::didSetMatrix(matrix);
806 } 801 }
807 802
808 void SkDeferredCanvas::onClipRect(const SkRect& rect, 803 void SkDeferredCanvas::onClipRect(const SkRect& rect,
809 SkRegion::Op op, 804 SkRegion::Op op,
810 ClipEdgeStyle edgeStyle) { 805 ClipEdgeStyle edgeStyle) {
811 this->drawingCanvas()->clipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle); 806 this->drawingCanvas()->clipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle);
812 this->INHERITED::onClipRect(rect, op, edgeStyle); 807 this->INHERITED::onClipRect(rect, op, edgeStyle);
813 this->recordedDrawCommand(); 808 this->recordedDrawCommand();
814 } 809 }
815 810
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { 1027 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
1033 this->drawingCanvas()->setDrawFilter(filter); 1028 this->drawingCanvas()->setDrawFilter(filter);
1034 this->INHERITED::setDrawFilter(filter); 1029 this->INHERITED::setDrawFilter(filter);
1035 this->recordedDrawCommand(); 1030 this->recordedDrawCommand();
1036 return filter; 1031 return filter;
1037 } 1032 }
1038 1033
1039 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { 1034 SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
1040 return this->drawingCanvas(); 1035 return this->drawingCanvas();
1041 } 1036 }
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