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

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

Issue 777643003: use ClipOp instead of SkRegion for clipping (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « src/utils/SkCanvasStack.cpp ('k') | src/utils/SkGatherPixelRefsAndRects.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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 705
706 void SkDeferredCanvas::didSetMatrix(const SkMatrix& matrix) { 706 void SkDeferredCanvas::didSetMatrix(const SkMatrix& matrix) {
707 this->drawingCanvas()->setMatrix(matrix); 707 this->drawingCanvas()->setMatrix(matrix);
708 this->recordedDrawCommand(); 708 this->recordedDrawCommand();
709 this->INHERITED::didSetMatrix(matrix); 709 this->INHERITED::didSetMatrix(matrix);
710 } 710 }
711 711
712 void SkDeferredCanvas::onClipRect(const SkRect& rect, 712 void SkDeferredCanvas::onClipRect(const SkRect& rect,
713 SkRegion::Op op, 713 SkRegion::Op op,
714 ClipEdgeStyle edgeStyle) { 714 ClipEdgeStyle edgeStyle) {
715 this->drawingCanvas()->clipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle); 715 this->drawingCanvas()->legacyClipRect(rect, op, kSoft_ClipEdgeStyle == edgeS tyle);
716 this->INHERITED::onClipRect(rect, op, edgeStyle); 716 this->INHERITED::onClipRect(rect, op, edgeStyle);
717 this->recordedDrawCommand(); 717 this->recordedDrawCommand();
718 } 718 }
719 719
720 void SkDeferredCanvas::onClipRRect(const SkRRect& rrect, 720 void SkDeferredCanvas::onClipRRect(const SkRRect& rrect,
721 SkRegion::Op op, 721 SkRegion::Op op,
722 ClipEdgeStyle edgeStyle) { 722 ClipEdgeStyle edgeStyle) {
723 this->drawingCanvas()->clipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle ); 723 this->drawingCanvas()->legacyClipRRect(rrect, op, kSoft_ClipEdgeStyle == edg eStyle);
724 this->INHERITED::onClipRRect(rrect, op, edgeStyle); 724 this->INHERITED::onClipRRect(rrect, op, edgeStyle);
725 this->recordedDrawCommand(); 725 this->recordedDrawCommand();
726 } 726 }
727 727
728 void SkDeferredCanvas::onClipPath(const SkPath& path, 728 void SkDeferredCanvas::onClipPath(const SkPath& path,
729 SkRegion::Op op, 729 SkRegion::Op op,
730 ClipEdgeStyle edgeStyle) { 730 ClipEdgeStyle edgeStyle) {
731 this->drawingCanvas()->clipPath(path, op, kSoft_ClipEdgeStyle == edgeStyle); 731 this->drawingCanvas()->legacyClipPath(path, op, kSoft_ClipEdgeStyle == edgeS tyle);
732 this->INHERITED::onClipPath(path, op, edgeStyle); 732 this->INHERITED::onClipPath(path, op, edgeStyle);
733 this->recordedDrawCommand(); 733 this->recordedDrawCommand();
734 } 734 }
735 735
736 void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 736 void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
737 this->drawingCanvas()->clipRegion(deviceRgn, op); 737 this->drawingCanvas()->legacyClipRegion(deviceRgn, op);
738 this->INHERITED::onClipRegion(deviceRgn, op); 738 this->INHERITED::onClipRegion(deviceRgn, op);
739 this->recordedDrawCommand(); 739 this->recordedDrawCommand();
740 } 740 }
741 741
742 void SkDeferredCanvas::drawPaint(const SkPaint& paint) { 742 void SkDeferredCanvas::drawPaint(const SkPaint& paint) {
743 if (fDeferredDrawing && this->isFullFrame(NULL, &paint) && 743 if (fDeferredDrawing && this->isFullFrame(NULL, &paint) &&
744 isPaintOpaque(&paint)) { 744 isPaintOpaque(&paint)) {
745 this->getDeferredDevice()->skipPendingCommands(); 745 this->getDeferredDevice()->skipPendingCommands();
746 } 746 }
747 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); 747 AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { 932 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
933 this->drawingCanvas()->setDrawFilter(filter); 933 this->drawingCanvas()->setDrawFilter(filter);
934 this->INHERITED::setDrawFilter(filter); 934 this->INHERITED::setDrawFilter(filter);
935 this->recordedDrawCommand(); 935 this->recordedDrawCommand();
936 return filter; 936 return filter;
937 } 937 }
938 938
939 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { 939 SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
940 return this->drawingCanvas(); 940 return this->drawingCanvas();
941 } 941 }
OLDNEW
« no previous file with comments | « src/utils/SkCanvasStack.cpp ('k') | src/utils/SkGatherPixelRefsAndRects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698