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