| 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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 this->isFullFrame(&dst, paint) && | 822 this->isFullFrame(&dst, paint) && |
| 823 isPaintOpaque(paint, &bitmap)) { | 823 isPaintOpaque(paint, &bitmap)) { |
| 824 this->getDeferredDevice()->skipPendingCommands(); | 824 this->getDeferredDevice()->skipPendingCommands(); |
| 825 } | 825 } |
| 826 | 826 |
| 827 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); | 827 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); |
| 828 this->drawingCanvas()->drawBitmapRectToRect(bitmap, src, dst, paint, flags); | 828 this->drawingCanvas()->drawBitmapRectToRect(bitmap, src, dst, paint, flags); |
| 829 this->recordedDrawCommand(); | 829 this->recordedDrawCommand(); |
| 830 } | 830 } |
| 831 | 831 |
| 832 | |
| 833 void SkDeferredCanvas::drawBitmapMatrix(const SkBitmap& bitmap, | |
| 834 const SkMatrix& m, | |
| 835 const SkPaint* paint) { | |
| 836 // TODO: reset recording canvas if paint+bitmap is opaque and clip rect | |
| 837 // covers canvas entirely and transformed bitmap covers canvas entirely | |
| 838 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); | |
| 839 this->drawingCanvas()->drawBitmapMatrix(bitmap, m, paint); | |
| 840 this->recordedDrawCommand(); | |
| 841 } | |
| 842 | |
| 843 void SkDeferredCanvas::drawBitmapNine(const SkBitmap& bitmap, | 832 void SkDeferredCanvas::drawBitmapNine(const SkBitmap& bitmap, |
| 844 const SkIRect& center, const SkRect& dst, | 833 const SkIRect& center, const SkRect& dst, |
| 845 const SkPaint* paint) { | 834 const SkPaint* paint) { |
| 846 // TODO: reset recording canvas if paint+bitmap is opaque and clip rect | 835 // TODO: reset recording canvas if paint+bitmap is opaque and clip rect |
| 847 // covers canvas entirely and dst covers canvas entirely | 836 // covers canvas entirely and dst covers canvas entirely |
| 848 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); | 837 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); |
| 849 this->drawingCanvas()->drawBitmapNine(bitmap, center, dst, paint); | 838 this->drawingCanvas()->drawBitmapNine(bitmap, center, dst, paint); |
| 850 this->recordedDrawCommand(); | 839 this->recordedDrawCommand(); |
| 851 } | 840 } |
| 852 | 841 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { | 921 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { |
| 933 this->drawingCanvas()->setDrawFilter(filter); | 922 this->drawingCanvas()->setDrawFilter(filter); |
| 934 this->INHERITED::setDrawFilter(filter); | 923 this->INHERITED::setDrawFilter(filter); |
| 935 this->recordedDrawCommand(); | 924 this->recordedDrawCommand(); |
| 936 return filter; | 925 return filter; |
| 937 } | 926 } |
| 938 | 927 |
| 939 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { | 928 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { |
| 940 return this->drawingCanvas(); | 929 return this->drawingCanvas(); |
| 941 } | 930 } |
| OLD | NEW |