OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2640 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, nullptr) | 2640 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, nullptr) |
2641 | 2641 |
2642 while (iter.next()) { | 2642 while (iter.next()) { |
2643 iter.fDevice->drawTextOnPath(iter, text, byteLength, path, | 2643 iter.fDevice->drawTextOnPath(iter, text, byteLength, path, |
2644 matrix, looper.paint()); | 2644 matrix, looper.paint()); |
2645 } | 2645 } |
2646 | 2646 |
2647 LOOPER_END | 2647 LOOPER_END |
2648 } | 2648 } |
2649 | 2649 |
| 2650 void SkCanvas::onDrawTextRSXform(const void* text, size_t byteLength, const SkRS
Xform xform[], |
| 2651 const SkPaint& paint) { |
| 2652 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, nullptr) |
| 2653 |
| 2654 while (iter.next()) { |
| 2655 iter.fDevice->drawTextRSXform(iter, text, byteLength, xform, looper.pain
t()); |
| 2656 } |
| 2657 |
| 2658 LOOPER_END |
| 2659 } |
| 2660 |
2650 void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, | 2661 void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
2651 const SkPaint& paint) { | 2662 const SkPaint& paint) { |
2652 | 2663 |
2653 SkRect storage; | 2664 SkRect storage; |
2654 const SkRect* bounds = nullptr; | 2665 const SkRect* bounds = nullptr; |
2655 if (paint.canComputeFastBounds()) { | 2666 if (paint.canComputeFastBounds()) { |
2656 storage = blob->bounds().makeOffset(x, y); | 2667 storage = blob->bounds().makeOffset(x, y); |
2657 SkRect tmp; | 2668 SkRect tmp; |
2658 if (this->quickReject(paint.computeFastBounds(storage, &tmp))) { | 2669 if (this->quickReject(paint.computeFastBounds(storage, &tmp))) { |
2659 return; | 2670 return; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2692 void SkCanvas::drawPosTextH(const void* text, size_t byteLength, const SkScalar
xpos[], | 2703 void SkCanvas::drawPosTextH(const void* text, size_t byteLength, const SkScalar
xpos[], |
2693 SkScalar constY, const SkPaint& paint) { | 2704 SkScalar constY, const SkPaint& paint) { |
2694 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPosTextH()"); | 2705 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPosTextH()"); |
2695 this->onDrawPosTextH(text, byteLength, xpos, constY, paint); | 2706 this->onDrawPosTextH(text, byteLength, xpos, constY, paint); |
2696 } | 2707 } |
2697 void SkCanvas::drawTextOnPath(const void* text, size_t byteLength, const SkPath&
path, | 2708 void SkCanvas::drawTextOnPath(const void* text, size_t byteLength, const SkPath&
path, |
2698 const SkMatrix* matrix, const SkPaint& paint) { | 2709 const SkMatrix* matrix, const SkPaint& paint) { |
2699 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextOnPath()"); | 2710 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextOnPath()"); |
2700 this->onDrawTextOnPath(text, byteLength, path, matrix, paint); | 2711 this->onDrawTextOnPath(text, byteLength, path, matrix, paint); |
2701 } | 2712 } |
| 2713 void SkCanvas::drawTextRSXform(const void* text, size_t byteLength, const SkRSXf
orm xform[], |
| 2714 const SkPaint& paint) { |
| 2715 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextRSXform()"); |
| 2716 if (byteLength) { |
| 2717 this->onDrawTextRSXform(text, byteLength, xform, paint); |
| 2718 } |
| 2719 } |
2702 void SkCanvas::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, | 2720 void SkCanvas::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
2703 const SkPaint& paint) { | 2721 const SkPaint& paint) { |
2704 RETURN_ON_NULL(blob); | 2722 RETURN_ON_NULL(blob); |
2705 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextBlob()"); | 2723 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextBlob()"); |
2706 this->onDrawTextBlob(blob, x, y, paint); | 2724 this->onDrawTextBlob(blob, x, y, paint); |
2707 } | 2725 } |
2708 | 2726 |
2709 void SkCanvas::onDrawVertices(VertexMode vmode, int vertexCount, | 2727 void SkCanvas::onDrawVertices(VertexMode vmode, int vertexCount, |
2710 const SkPoint verts[], const SkPoint texs[], | 2728 const SkPoint verts[], const SkPoint texs[], |
2711 const SkColor colors[], SkXfermode* xmode, | 2729 const SkColor colors[], SkXfermode* xmode, |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3094 | 3112 |
3095 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3113 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3096 fCanvas->restoreToCount(fSaveCount); | 3114 fCanvas->restoreToCount(fSaveCount); |
3097 } | 3115 } |
3098 | 3116 |
3099 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3117 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
3100 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 3118 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
3101 return this->makeSurface(info, props).release(); | 3119 return this->makeSurface(info, props).release(); |
3102 } | 3120 } |
3103 #endif | 3121 #endif |
OLD | NEW |