Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 void drawTextBlob(const SkTextBlob* blob, const SkPoint& offset, const SkPai nt& paint); | |
|
reed1
2014/08/14 15:55:49
For consistency (and because I think having to con
f(malita)
2014/08/14 16:27:01
SGTM, will do.
| |
| 961 | |
| 959 /** PRIVATE / EXPERIMENTAL -- do not call | 962 /** PRIVATE / EXPERIMENTAL -- do not call |
| 960 Perform back-end analysis/optimization of a picture. This may attach | 963 Perform back-end analysis/optimization of a picture. This may attach |
| 961 optimization data to the picture which can be used by a later | 964 optimization data to the picture which can be used by a later |
| 962 drawPicture call. | 965 drawPicture call. |
| 963 @param picture The recorded drawing commands to analyze/optimize | 966 @param picture The recorded drawing commands to analyze/optimize |
| 964 */ | 967 */ |
| 965 void EXPERIMENTAL_optimize(const SkPicture* picture); | 968 void EXPERIMENTAL_optimize(const SkPicture* picture); |
| 966 | 969 |
| 967 /** Draw the picture into this canvas. This method effective brackets the | 970 /** 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 | 971 playback of the picture's draw calls with save/restore, so the state |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1223 virtual void onDrawPosText(const void* text, size_t byteLength, | 1226 virtual void onDrawPosText(const void* text, size_t byteLength, |
| 1224 const SkPoint pos[], const SkPaint& paint); | 1227 const SkPoint pos[], const SkPaint& paint); |
| 1225 | 1228 |
| 1226 virtual void onDrawPosTextH(const void* text, size_t byteLength, | 1229 virtual void onDrawPosTextH(const void* text, size_t byteLength, |
| 1227 const SkScalar xpos[], SkScalar constY, | 1230 const SkScalar xpos[], SkScalar constY, |
| 1228 const SkPaint& paint); | 1231 const SkPaint& paint); |
| 1229 | 1232 |
| 1230 virtual void onDrawTextOnPath(const void* text, size_t byteLength, | 1233 virtual void onDrawTextOnPath(const void* text, size_t byteLength, |
| 1231 const SkPath& path, const SkMatrix* matrix, | 1234 const SkPath& path, const SkMatrix* matrix, |
| 1232 const SkPaint& paint); | 1235 const SkPaint& paint); |
| 1236 | |
| 1237 virtual void onDrawTextBlob(const SkTextBlob* blob, const SkPoint& offset, | |
| 1238 const SkPaint& paint); | |
| 1233 | 1239 |
| 1234 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 1240 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
| 1235 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint); | 1241 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint); |
| 1236 | 1242 |
| 1237 enum ClipEdgeStyle { | 1243 enum ClipEdgeStyle { |
| 1238 kHard_ClipEdgeStyle, | 1244 kHard_ClipEdgeStyle, |
| 1239 kSoft_ClipEdgeStyle | 1245 kSoft_ClipEdgeStyle |
| 1240 }; | 1246 }; |
| 1241 | 1247 |
| 1242 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle); | 1248 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1505 | 1511 |
| 1506 class SkCanvasClipVisitor { | 1512 class SkCanvasClipVisitor { |
| 1507 public: | 1513 public: |
| 1508 virtual ~SkCanvasClipVisitor(); | 1514 virtual ~SkCanvasClipVisitor(); |
| 1509 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1515 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
| 1510 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1516 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
| 1511 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1517 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
| 1512 }; | 1518 }; |
| 1513 | 1519 |
| 1514 #endif | 1520 #endif |
| OLD | NEW |