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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 this->isFullFrame(&bitmapRect, paint) && | 897 this->isFullFrame(&bitmapRect, paint) && |
898 isPaintOpaque(paint, &bitmap)) { | 898 isPaintOpaque(paint, &bitmap)) { |
899 this->getDeferredDevice()->skipPendingCommands(); | 899 this->getDeferredDevice()->skipPendingCommands(); |
900 } | 900 } |
901 | 901 |
902 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); | 902 AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint); |
903 this->drawingCanvas()->drawSprite(bitmap, left, top, paint); | 903 this->drawingCanvas()->drawSprite(bitmap, left, top, paint); |
904 this->recordedDrawCommand(); | 904 this->recordedDrawCommand(); |
905 } | 905 } |
906 | 906 |
907 void SkDeferredCanvas::onDrawText(const void* text, size_t byteLength, SkScalar
x, SkScalar y, | 907 void SkDeferredCanvas::drawText(const void* text, size_t byteLength, |
908 const SkPaint& paint) { | 908 SkScalar x, SkScalar y, const SkPaint& paint) { |
909 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); | 909 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); |
910 this->drawingCanvas()->drawText(text, byteLength, x, y, paint); | 910 this->drawingCanvas()->drawText(text, byteLength, x, y, paint); |
911 this->recordedDrawCommand(); | 911 this->recordedDrawCommand(); |
912 } | 912 } |
913 | 913 |
914 void SkDeferredCanvas::onDrawPosText(const void* text, size_t byteLength, const
SkPoint pos[], | 914 void SkDeferredCanvas::drawPosText(const void* text, size_t byteLength, |
915 const SkPaint& paint) { | 915 const SkPoint pos[], const SkPaint& paint) { |
916 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); | 916 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); |
917 this->drawingCanvas()->drawPosText(text, byteLength, pos, paint); | 917 this->drawingCanvas()->drawPosText(text, byteLength, pos, paint); |
918 this->recordedDrawCommand(); | 918 this->recordedDrawCommand(); |
919 } | 919 } |
920 | 920 |
921 void SkDeferredCanvas::onDrawPosTextH(const void* text, size_t byteLength, const
SkScalar xpos[], | 921 void SkDeferredCanvas::drawPosTextH(const void* text, size_t byteLength, |
922 SkScalar constY, const SkPaint& paint) { | 922 const SkScalar xpos[], SkScalar constY, |
| 923 const SkPaint& paint) { |
923 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); | 924 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); |
924 this->drawingCanvas()->drawPosTextH(text, byteLength, xpos, constY, paint); | 925 this->drawingCanvas()->drawPosTextH(text, byteLength, xpos, constY, paint); |
925 this->recordedDrawCommand(); | 926 this->recordedDrawCommand(); |
926 } | 927 } |
927 | 928 |
928 void SkDeferredCanvas::onDrawTextOnPath(const void* text, size_t byteLength, con
st SkPath& path, | 929 void SkDeferredCanvas::drawTextOnPath(const void* text, size_t byteLength, |
929 const SkMatrix* matrix, const SkPaint& p
aint) { | 930 const SkPath& path, |
| 931 const SkMatrix* matrix, |
| 932 const SkPaint& paint) { |
930 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); | 933 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); |
931 this->drawingCanvas()->drawTextOnPath(text, byteLength, path, matrix, paint)
; | 934 this->drawingCanvas()->drawTextOnPath(text, byteLength, path, matrix, paint)
; |
932 this->recordedDrawCommand(); | 935 this->recordedDrawCommand(); |
933 } | 936 } |
934 | 937 |
935 void SkDeferredCanvas::drawPicture(SkPicture& picture) { | 938 void SkDeferredCanvas::drawPicture(SkPicture& picture) { |
936 this->drawingCanvas()->drawPicture(picture); | 939 this->drawingCanvas()->drawPicture(picture); |
937 this->recordedDrawCommand(); | 940 this->recordedDrawCommand(); |
938 } | 941 } |
939 | 942 |
(...skipping 19 matching lines...) Expand all Loading... |
959 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { | 962 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { |
960 this->drawingCanvas()->setDrawFilter(filter); | 963 this->drawingCanvas()->setDrawFilter(filter); |
961 this->INHERITED::setDrawFilter(filter); | 964 this->INHERITED::setDrawFilter(filter); |
962 this->recordedDrawCommand(); | 965 this->recordedDrawCommand(); |
963 return filter; | 966 return filter; |
964 } | 967 } |
965 | 968 |
966 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { | 969 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { |
967 return this->drawingCanvas(); | 970 return this->drawingCanvas(); |
968 } | 971 } |
OLD | NEW |