| 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 } | 886 } |
| 887 | 887 |
| 888 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); | 888 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); |
| 889 this->drawingCanvas()->drawBitmap(bitmap, left, top, paint); | 889 this->drawingCanvas()->drawBitmap(bitmap, left, top, paint); |
| 890 this->recordedDrawCommand(); | 890 this->recordedDrawCommand(); |
| 891 } | 891 } |
| 892 | 892 |
| 893 void SkDeferredCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, | 893 void SkDeferredCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, |
| 894 const SkRect* src, | 894 const SkRect* src, |
| 895 const SkRect& dst, | 895 const SkRect& dst, |
| 896 const SkPaint* paint) { | 896 const SkPaint* paint, |
| 897 DrawBitmapRectFlags flags) { |
| 897 if (fDeferredDrawing && | 898 if (fDeferredDrawing && |
| 898 this->isFullFrame(&dst, paint) && | 899 this->isFullFrame(&dst, paint) && |
| 899 isPaintOpaque(paint, &bitmap)) { | 900 isPaintOpaque(paint, &bitmap)) { |
| 900 this->getDeferredDevice()->skipPendingCommands(); | 901 this->getDeferredDevice()->skipPendingCommands(); |
| 901 } | 902 } |
| 902 | 903 |
| 903 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); | 904 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); |
| 904 this->drawingCanvas()->drawBitmapRectToRect(bitmap, src, dst, paint); | 905 this->drawingCanvas()->drawBitmapRectToRect(bitmap, src, dst, paint, flags); |
| 905 this->recordedDrawCommand(); | 906 this->recordedDrawCommand(); |
| 906 } | 907 } |
| 907 | 908 |
| 908 | 909 |
| 909 void SkDeferredCanvas::drawBitmapMatrix(const SkBitmap& bitmap, | 910 void SkDeferredCanvas::drawBitmapMatrix(const SkBitmap& bitmap, |
| 910 const SkMatrix& m, | 911 const SkMatrix& m, |
| 911 const SkPaint* paint) { | 912 const SkPaint* paint) { |
| 912 // TODO: reset recording canvas if paint+bitmap is opaque and clip rect | 913 // TODO: reset recording canvas if paint+bitmap is opaque and clip rect |
| 913 // covers canvas entirely and transformed bitmap covers canvas entirely | 914 // covers canvas entirely and transformed bitmap covers canvas entirely |
| 914 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); | 915 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { | 1003 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { |
| 1003 this->drawingCanvas()->setDrawFilter(filter); | 1004 this->drawingCanvas()->setDrawFilter(filter); |
| 1004 this->INHERITED::setDrawFilter(filter); | 1005 this->INHERITED::setDrawFilter(filter); |
| 1005 this->recordedDrawCommand(); | 1006 this->recordedDrawCommand(); |
| 1006 return filter; | 1007 return filter; |
| 1007 } | 1008 } |
| 1008 | 1009 |
| 1009 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { | 1010 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { |
| 1010 return this->drawingCanvas(); | 1011 return this->drawingCanvas(); |
| 1011 } | 1012 } |
| OLD | NEW |