| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |