Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: src/core/SkCanvas.cpp

Issue 2130643004: drawTextRSXform (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update util canvases Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 SkRect* cullRect, const SkPaint& paint) {
2652 if (cullRect && this->quickReject(*cullRect)) {
2653 return;
2654 }
2655
2656 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, nullptr)
2657
2658 while (iter.next()) {
2659 iter.fDevice->drawTextRSXform(iter, text, byteLength, xform, looper.pain t());
2660 }
2661
2662 LOOPER_END
2663 }
2664
2650 void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, 2665 void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
2651 const SkPaint& paint) { 2666 const SkPaint& paint) {
2652 2667
2653 SkRect storage; 2668 SkRect storage;
2654 const SkRect* bounds = nullptr; 2669 const SkRect* bounds = nullptr;
2655 if (paint.canComputeFastBounds()) { 2670 if (paint.canComputeFastBounds()) {
2656 storage = blob->bounds().makeOffset(x, y); 2671 storage = blob->bounds().makeOffset(x, y);
2657 SkRect tmp; 2672 SkRect tmp;
2658 if (this->quickReject(paint.computeFastBounds(storage, &tmp))) { 2673 if (this->quickReject(paint.computeFastBounds(storage, &tmp))) {
2659 return; 2674 return;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 void SkCanvas::drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], 2707 void SkCanvas::drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
2693 SkScalar constY, const SkPaint& paint) { 2708 SkScalar constY, const SkPaint& paint) {
2694 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPosTextH()"); 2709 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPosTextH()");
2695 this->onDrawPosTextH(text, byteLength, xpos, constY, paint); 2710 this->onDrawPosTextH(text, byteLength, xpos, constY, paint);
2696 } 2711 }
2697 void SkCanvas::drawTextOnPath(const void* text, size_t byteLength, const SkPath& path, 2712 void SkCanvas::drawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
2698 const SkMatrix* matrix, const SkPaint& paint) { 2713 const SkMatrix* matrix, const SkPaint& paint) {
2699 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextOnPath()"); 2714 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextOnPath()");
2700 this->onDrawTextOnPath(text, byteLength, path, matrix, paint); 2715 this->onDrawTextOnPath(text, byteLength, path, matrix, paint);
2701 } 2716 }
2717 void SkCanvas::drawTextRSXform(const void* text, size_t byteLength, const SkRSXf orm xform[],
2718 const SkRect* cullRect, const SkPaint& paint) {
2719 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextRSXform()");
2720 if (byteLength) {
2721 this->onDrawTextRSXform(text, byteLength, xform, cullRect, paint);
2722 }
2723 }
2702 void SkCanvas::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, 2724 void SkCanvas::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
2703 const SkPaint& paint) { 2725 const SkPaint& paint) {
2704 RETURN_ON_NULL(blob); 2726 RETURN_ON_NULL(blob);
2705 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextBlob()"); 2727 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextBlob()");
2706 this->onDrawTextBlob(blob, x, y, paint); 2728 this->onDrawTextBlob(blob, x, y, paint);
2707 } 2729 }
2708 2730
2709 void SkCanvas::onDrawVertices(VertexMode vmode, int vertexCount, 2731 void SkCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
2710 const SkPoint verts[], const SkPoint texs[], 2732 const SkPoint verts[], const SkPoint texs[],
2711 const SkColor colors[], SkXfermode* xmode, 2733 const SkColor colors[], SkXfermode* xmode,
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
3094 3116
3095 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3117 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3096 fCanvas->restoreToCount(fSaveCount); 3118 fCanvas->restoreToCount(fSaveCount);
3097 } 3119 }
3098 3120
3099 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3121 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3100 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3122 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3101 return this->makeSurface(info, props).release(); 3123 return this->makeSurface(info, props).release();
3102 } 3124 }
3103 #endif 3125 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698