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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
437 | 437 |
438 /** Replace the current matrix with a copy of the specified matrix. | 438 /** Replace the current matrix with a copy of the specified matrix. |
439 @param matrix The matrix that will be copied into the current matrix. | 439 @param matrix The matrix that will be copied into the current matrix. |
440 */ | 440 */ |
441 void setMatrix(const SkMatrix& matrix); | 441 void setMatrix(const SkMatrix& matrix); |
442 | 442 |
443 /** Helper for setMatrix(identity). Sets the current matrix to identity. | 443 /** Helper for setMatrix(identity). Sets the current matrix to identity. |
444 */ | 444 */ |
445 void resetMatrix(); | 445 void resetMatrix(); |
446 | 446 |
447 /** Set the current draw depth of the canvas. | |
robertphillips
2016/07/08 17:26:43
Fix this comment
vjiaoblack
2016/07/11 18:04:42
Done.
| |
448 @param z The integer depth, intended between 0 - 255 inclusive | |
449 0 is lowest (into screen), 255 is highest (out of screen) | |
robertphillips
2016/07/08 17:26:43
Add info that this plays in the save/restore stack
vjiaoblack
2016/07/11 18:04:42
Done.
| |
450 */ | |
451 void setZ(SkScalar z); | |
452 | |
453 /** Returns the current draw depth of the canvas. | |
454 */ | |
robertphillips
2016/07/08 17:26:43
Fix return value
vjiaoblack
2016/07/11 18:04:42
Done.
| |
455 uint32_t getZ() const; | |
456 | |
447 /** | 457 /** |
448 * Modify the current clip with the specified rectangle. | 458 * Modify the current clip with the specified rectangle. |
449 * @param rect The rect to combine with the current clip | 459 * @param rect The rect to combine with the current clip |
450 * @param op The region op to apply to the current clip | 460 * @param op The region op to apply to the current clip |
451 * @param doAntiAlias true if the clip should be antialiased | 461 * @param doAntiAlias true if the clip should be antialiased |
452 */ | 462 */ |
453 void clipRect(const SkRect& rect, | 463 void clipRect(const SkRect& rect, |
454 SkRegion::Op op = SkRegion::kIntersect_Op, | 464 SkRegion::Op op = SkRegion::kIntersect_Op, |
455 bool doAntiAlias = false); | 465 bool doAntiAlias = false); |
456 | 466 |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1299 }; | 1309 }; |
1300 | 1310 |
1301 virtual void willSave() {} | 1311 virtual void willSave() {} |
1302 // Overriders should call the corresponding INHERITED method up the inherita nce chain. | 1312 // Overriders should call the corresponding INHERITED method up the inherita nce chain. |
1303 virtual SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) { | 1313 virtual SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) { |
1304 return kFullLayer_SaveLayerStrategy; | 1314 return kFullLayer_SaveLayerStrategy; |
1305 } | 1315 } |
1306 virtual void willRestore() {} | 1316 virtual void willRestore() {} |
1307 virtual void didRestore() {} | 1317 virtual void didRestore() {} |
1308 virtual void didConcat(const SkMatrix&) {} | 1318 virtual void didConcat(const SkMatrix&) {} |
1309 virtual void didSetMatrix(const SkMatrix&) {} | 1319 virtual void didSetMatrix(const SkMatrix&) {} |
robertphillips
2016/07/08 17:26:42
don't need const on a scalar
vjiaoblack
2016/07/11 18:04:42
Done.
| |
1320 virtual void didSetZ(const SkScalar) {} | |
1310 | 1321 |
1311 virtual void onDrawAnnotation(const SkRect&, const char key[], SkData* value ); | 1322 virtual void onDrawAnnotation(const SkRect&, const char key[], SkData* value ); |
1312 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); | 1323 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); |
1313 | 1324 |
1314 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, | 1325 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, |
1315 SkScalar y, const SkPaint& paint); | 1326 SkScalar y, const SkPaint& paint); |
1316 | 1327 |
1317 virtual void onDrawPosText(const void* text, size_t byteLength, | 1328 virtual void onDrawPosText(const void* text, size_t byteLength, |
1318 const SkPoint pos[], const SkPaint& paint); | 1329 const SkPoint pos[], const SkPaint& paint); |
1319 | 1330 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1585 | 1596 |
1586 class SkCanvasClipVisitor { | 1597 class SkCanvasClipVisitor { |
1587 public: | 1598 public: |
1588 virtual ~SkCanvasClipVisitor(); | 1599 virtual ~SkCanvasClipVisitor(); |
1589 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; | 1600 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; |
1590 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; | 1601 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; |
1591 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; | 1602 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; |
1592 }; | 1603 }; |
1593 | 1604 |
1594 #endif | 1605 #endif |
OLD | NEW |