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

Side by Side Diff: include/core/SkCanvas.h

Issue 473633002: SkTextBlob (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Alloc API + review comments Created 6 years, 4 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 2006 The Android Open Source Project 2 * Copyright 2006 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 #ifndef SkCanvas_DEFINED 8 #ifndef SkCanvas_DEFINED
9 #define SkCanvas_DEFINED 9 #define SkCanvas_DEFINED
10 10
(...skipping 15 matching lines...) Expand all
26 26
27 class SkCanvasClipVisitor; 27 class SkCanvasClipVisitor;
28 class SkBaseDevice; 28 class SkBaseDevice;
29 class SkDraw; 29 class SkDraw;
30 class SkDrawFilter; 30 class SkDrawFilter;
31 class SkMetaData; 31 class SkMetaData;
32 class SkPicture; 32 class SkPicture;
33 class SkRRect; 33 class SkRRect;
34 class SkSurface; 34 class SkSurface;
35 class SkSurface_Base; 35 class SkSurface_Base;
36 class SkTextBlob;
36 class GrContext; 37 class GrContext;
37 class GrRenderTarget; 38 class GrRenderTarget;
38 39
39 /** \class SkCanvas 40 /** \class SkCanvas
40 41
41 A Canvas encapsulates all of the state about drawing into a device (bitmap). 42 A Canvas encapsulates all of the state about drawing into a device (bitmap).
42 This includes a reference to the device itself, and a stack of matrix/clip 43 This includes a reference to the device itself, and a stack of matrix/clip
43 values. For any given draw call (e.g. drawRect), the geometry of the object 44 values. For any given draw call (e.g. drawRect), the geometry of the object
44 being drawn is transformed by the concatenation of all the matrices in the 45 being drawn is transformed by the concatenation of all the matrices in the
45 stack. The transformed geometry is clipped by the intersection of all of 46 stack. The transformed geometry is clipped by the intersection of all of
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 @param byteLength The number of bytes to read from the text parameter 950 @param byteLength The number of bytes to read from the text parameter
950 @param path The path the text should follow for its baseline 951 @param path The path the text should follow for its baseline
951 @param matrix (may be null) Applied to the text before it is 952 @param matrix (may be null) Applied to the text before it is
952 mapped onto the path 953 mapped onto the path
953 @param paint The paint used for the text 954 @param paint The paint used for the text
954 */ 955 */
955 SK_LEGACY_DRAWTEXT_VIRTUAL void drawTextOnPath(const void* text, size_t byte Length, 956 SK_LEGACY_DRAWTEXT_VIRTUAL void drawTextOnPath(const void* text, size_t byte Length,
956 const SkPath& path, const SkMatrix* matrix, 957 const SkPath& path, const SkMatrix* matrix,
957 const SkPaint& paint); 958 const SkPaint& paint);
958 959
960 /** Draw the text blob, offset by (x,y), using the specified paint.
961 @param blob The text blob to be drawn
962 @param x The x-offset of the text being drawn
963 @param y The y-offset of the text being drawn
964 @param paint The paint used for the text (e.g. color, size, style)
965 */
966 void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPa int& paint);
967
959 /** PRIVATE / EXPERIMENTAL -- do not call 968 /** PRIVATE / EXPERIMENTAL -- do not call
960 Perform back-end analysis/optimization of a picture. This may attach 969 Perform back-end analysis/optimization of a picture. This may attach
961 optimization data to the picture which can be used by a later 970 optimization data to the picture which can be used by a later
962 drawPicture call. 971 drawPicture call.
963 @param picture The recorded drawing commands to analyze/optimize 972 @param picture The recorded drawing commands to analyze/optimize
964 */ 973 */
965 void EXPERIMENTAL_optimize(const SkPicture* picture); 974 void EXPERIMENTAL_optimize(const SkPicture* picture);
966 975
967 /** Draw the picture into this canvas. This method effective brackets the 976 /** Draw the picture into this canvas. This method effective brackets the
968 playback of the picture's draw calls with save/restore, so the state 977 playback of the picture's draw calls with save/restore, so the state
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 const SkPoint pos[], const SkPaint& paint); 1234 const SkPoint pos[], const SkPaint& paint);
1226 1235
1227 virtual void onDrawPosTextH(const void* text, size_t byteLength, 1236 virtual void onDrawPosTextH(const void* text, size_t byteLength,
1228 const SkScalar xpos[], SkScalar constY, 1237 const SkScalar xpos[], SkScalar constY,
1229 const SkPaint& paint); 1238 const SkPaint& paint);
1230 1239
1231 virtual void onDrawTextOnPath(const void* text, size_t byteLength, 1240 virtual void onDrawTextOnPath(const void* text, size_t byteLength,
1232 const SkPath& path, const SkMatrix* matrix, 1241 const SkPath& path, const SkMatrix* matrix,
1233 const SkPaint& paint); 1242 const SkPaint& paint);
1234 1243
1244 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
1245 const SkPaint& paint);
1246
1235 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], 1247 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
1236 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint); 1248 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint);
1237 1249
1238 enum ClipEdgeStyle { 1250 enum ClipEdgeStyle {
1239 kHard_ClipEdgeStyle, 1251 kHard_ClipEdgeStyle,
1240 kSoft_ClipEdgeStyle 1252 kSoft_ClipEdgeStyle
1241 }; 1253 };
1242 1254
1243 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle); 1255 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle);
1244 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle); 1256 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 1518
1507 class SkCanvasClipVisitor { 1519 class SkCanvasClipVisitor {
1508 public: 1520 public:
1509 virtual ~SkCanvasClipVisitor(); 1521 virtual ~SkCanvasClipVisitor();
1510 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; 1522 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0;
1511 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; 1523 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0;
1512 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; 1524 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0;
1513 }; 1525 };
1514 1526
1515 #endif 1527 #endif
OLDNEW
« no previous file with comments | « gyp/core.gypi ('k') | include/core/SkTextBlob.h » ('j') | include/core/SkTextBlob.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698