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::drawText(const void* text, size_t byteLength, | 907 void SkDeferredCanvas::onDrawText(const void* text, size_t byteLength, SkScalar
x, SkScalar y, |
908 SkScalar x, SkScalar y, const SkPaint& paint) { | 908 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::drawPosText(const void* text, size_t byteLength, | 914 void SkDeferredCanvas::onDrawPosText(const void* text, size_t byteLength, const
SkPoint pos[], |
915 const SkPoint pos[], const SkPaint& paint) { | 915 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::drawPosTextH(const void* text, size_t byteLength, | 921 void SkDeferredCanvas::onDrawPosTextH(const void* text, size_t byteLength, const
SkScalar xpos[], |
922 const SkScalar xpos[], SkScalar constY, | 922 SkScalar constY, const SkPaint& paint) { |
923 const SkPaint& paint) { | |
924 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); | 923 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); |
925 this->drawingCanvas()->drawPosTextH(text, byteLength, xpos, constY, paint); | 924 this->drawingCanvas()->drawPosTextH(text, byteLength, xpos, constY, paint); |
926 this->recordedDrawCommand(); | 925 this->recordedDrawCommand(); |
927 } | 926 } |
928 | 927 |
929 void SkDeferredCanvas::drawTextOnPath(const void* text, size_t byteLength, | 928 void SkDeferredCanvas::onDrawTextOnPath(const void* text, size_t byteLength, con
st SkPath& path, |
930 const SkPath& path, | 929 const SkMatrix* matrix, const SkPaint& p
aint) { |
931 const SkMatrix* matrix, | |
932 const SkPaint& paint) { | |
933 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); | 930 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); |
934 this->drawingCanvas()->drawTextOnPath(text, byteLength, path, matrix, paint)
; | 931 this->drawingCanvas()->drawTextOnPath(text, byteLength, path, matrix, paint)
; |
935 this->recordedDrawCommand(); | 932 this->recordedDrawCommand(); |
936 } | 933 } |
937 | 934 |
938 void SkDeferredCanvas::drawPicture(SkPicture& picture) { | 935 void SkDeferredCanvas::drawPicture(SkPicture& picture) { |
939 this->drawingCanvas()->drawPicture(picture); | 936 this->drawingCanvas()->drawPicture(picture); |
940 this->recordedDrawCommand(); | 937 this->recordedDrawCommand(); |
941 } | 938 } |
942 | 939 |
(...skipping 19 matching lines...) Expand all Loading... |
962 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { | 959 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { |
963 this->drawingCanvas()->setDrawFilter(filter); | 960 this->drawingCanvas()->setDrawFilter(filter); |
964 this->INHERITED::setDrawFilter(filter); | 961 this->INHERITED::setDrawFilter(filter); |
965 this->recordedDrawCommand(); | 962 this->recordedDrawCommand(); |
966 return filter; | 963 return filter; |
967 } | 964 } |
968 | 965 |
969 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { | 966 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { |
970 return this->drawingCanvas(); | 967 return this->drawingCanvas(); |
971 } | 968 } |
OLD | NEW |