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

Side by Side Diff: tools/debugger/SkDebugCanvas.cpp

Issue 2335493005: Use sk_sp text blob APIs (Closed)
Patch Set: SK_SUPPORT_LEGACY_TEXTBLOB_BUILDER Created 4 years, 3 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
« no previous file with comments | « tests/TextBlobTest.cpp ('k') | tools/debugger/SkDrawCommand.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
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 "SkCanvasPriv.h" 8 #include "SkCanvasPriv.h"
9 #include "SkClipStack.h" 9 #include "SkClipStack.h"
10 #include "SkDebugCanvas.h" 10 #include "SkDebugCanvas.h"
11 #include "SkDrawCommand.h" 11 #include "SkDrawCommand.h"
12 #include "SkOverdrawMode.h"
12 #include "SkPaintFilterCanvas.h" 13 #include "SkPaintFilterCanvas.h"
13 #include "SkOverdrawMode.h" 14 #include "SkTextBlob.h"
14 15
15 #if SK_SUPPORT_GPU 16 #if SK_SUPPORT_GPU
16 #include "GrAuditTrail.h" 17 #include "GrAuditTrail.h"
17 #include "GrContext.h" 18 #include "GrContext.h"
18 #include "GrRenderTarget.h" 19 #include "GrRenderTarget.h"
19 #include "SkGpuDevice.h" 20 #include "SkGpuDevice.h"
20 #endif 21 #endif
21 22
22 #define SKDEBUGCANVAS_VERSION 1 23 #define SKDEBUGCANVAS_VERSION 1
23 #define SKDEBUGCANVAS_ATTRIBUTE_VERSION "version" 24 #define SKDEBUGCANVAS_ATTRIBUTE_VERSION "version"
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint)); 671 new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint));
671 } 672 }
672 673
673 void SkDebugCanvas::onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[], 674 void SkDebugCanvas::onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
674 const SkRect* cull, const SkPaint& paint) { 675 const SkRect* cull, const SkPaint& paint) {
675 this->addDrawCommand(new SkDrawTextRSXformCommand(text, byteLength, xform, c ull, paint)); 676 this->addDrawCommand(new SkDrawTextRSXformCommand(text, byteLength, xform, c ull, paint));
676 } 677 }
677 678
678 void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, 679 void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
679 const SkPaint& paint) { 680 const SkPaint& paint) {
680 this->addDrawCommand(new SkDrawTextBlobCommand(blob, x, y, paint)); 681 this->addDrawCommand(new SkDrawTextBlobCommand(sk_ref_sp(const_cast<SkTextBl ob*>(blob)),
682 x, y, paint));
681 } 683 }
682 684
683 void SkDebugCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4 ], 685 void SkDebugCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4 ],
684 const SkPoint texCoords[4], SkXfermode* xmode, 686 const SkPoint texCoords[4], SkXfermode* xmode,
685 const SkPaint& paint) { 687 const SkPaint& paint) {
686 this->addDrawCommand(new SkDrawPatchCommand(cubics, colors, texCoords, xmode , paint)); 688 this->addDrawCommand(new SkDrawPatchCommand(cubics, colors, texCoords, xmode , paint));
687 } 689 }
688 690
689 void SkDebugCanvas::onDrawVertices(VertexMode vmode, int vertexCount, const SkPo int vertices[], 691 void SkDebugCanvas::onDrawVertices(VertexMode vmode, int vertexCount, const SkPo int vertices[],
690 const SkPoint texs[], const SkColor colors[], 692 const SkPoint texs[], const SkColor colors[],
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 } 847 }
846 848
847 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { 849 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) {
848 if (fCalledAddStackData) { 850 if (fCalledAddStackData) {
849 fClipStackData.appendf("<br>"); 851 fClipStackData.appendf("<br>");
850 addPathData(devPath, "pathOut"); 852 addPathData(devPath, "pathOut");
851 return true; 853 return true;
852 } 854 }
853 return false; 855 return false;
854 } 856 }
OLDNEW
« no previous file with comments | « tests/TextBlobTest.cpp ('k') | tools/debugger/SkDrawCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698