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

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

Issue 772533004: Change clear() to respect the clip (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox 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
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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 this->INHERITED::onClipPath(path, op, edgeStyle); 734 this->INHERITED::onClipPath(path, op, edgeStyle);
735 this->recordedDrawCommand(); 735 this->recordedDrawCommand();
736 } 736 }
737 737
738 void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 738 void SkDeferredCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
739 this->drawingCanvas()->clipRegion(deviceRgn, op); 739 this->drawingCanvas()->clipRegion(deviceRgn, op);
740 this->INHERITED::onClipRegion(deviceRgn, op); 740 this->INHERITED::onClipRegion(deviceRgn, op);
741 this->recordedDrawCommand(); 741 this->recordedDrawCommand();
742 } 742 }
743 743
744 void SkDeferredCanvas::clear(SkColor color) {
745 // purge pending commands
746 if (fDeferredDrawing) {
747 this->getDeferredDevice()->skipPendingCommands();
748 }
749
750 this->drawingCanvas()->clear(color);
751 this->recordedDrawCommand();
752 }
753
754 void SkDeferredCanvas::drawPaint(const SkPaint& paint) { 744 void SkDeferredCanvas::drawPaint(const SkPaint& paint) {
755 if (fDeferredDrawing && this->isFullFrame(NULL, &paint) && 745 if (fDeferredDrawing && this->isFullFrame(NULL, &paint) &&
756 isPaintOpaque(&paint)) { 746 isPaintOpaque(&paint)) {
757 this->getDeferredDevice()->skipPendingCommands(); 747 this->getDeferredDevice()->skipPendingCommands();
758 } 748 }
759 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); 749 AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
760 this->drawingCanvas()->drawPaint(paint); 750 this->drawingCanvas()->drawPaint(paint);
761 this->recordedDrawCommand(); 751 this->recordedDrawCommand();
762 } 752 }
763 753
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { 934 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
945 this->drawingCanvas()->setDrawFilter(filter); 935 this->drawingCanvas()->setDrawFilter(filter);
946 this->INHERITED::setDrawFilter(filter); 936 this->INHERITED::setDrawFilter(filter);
947 this->recordedDrawCommand(); 937 this->recordedDrawCommand();
948 return filter; 938 return filter;
949 } 939 }
950 940
951 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { 941 SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
952 return this->drawingCanvas(); 942 return this->drawingCanvas();
953 } 943 }
OLDNEW
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/utils/SkNWayCanvas.cpp » ('j') | tests/RecordDrawTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698