OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef SkDrawable_DEFINED | 8 #ifndef SkDrawable_DEFINED |
9 #define SkDrawable_DEFINED | 9 #define SkDrawable_DEFINED |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 */ | 23 */ |
24 class SkDrawable : public SkRefCnt { | 24 class SkDrawable : public SkRefCnt { |
25 public: | 25 public: |
26 SkDrawable(); | 26 SkDrawable(); |
27 | 27 |
28 /** | 28 /** |
29 * Draws into the specified content. The drawing sequence will be balanced
upon return | 29 * Draws into the specified content. The drawing sequence will be balanced
upon return |
30 * (i.e. the saveLevel() on the canvas will match what it was when draw() w
as called, | 30 * (i.e. the saveLevel() on the canvas will match what it was when draw() w
as called, |
31 * and the current matrix and clip settings will not be changed. | 31 * and the current matrix and clip settings will not be changed. |
32 */ | 32 */ |
33 void draw(SkCanvas*); | 33 void draw(SkCanvas*, const SkMatrix* = NULL); |
| 34 void draw(SkCanvas*, SkScalar x, SkScalar y); |
34 | 35 |
35 SkPicture* newPictureSnapshot(); | 36 SkPicture* newPictureSnapshot(); |
36 | 37 |
37 /** | 38 /** |
38 * Return a unique value for this instance. If two calls to this return the
same value, | 39 * Return a unique value for this instance. If two calls to this return the
same value, |
39 * it is presumed that calling the draw() method will render the same thing
as well. | 40 * it is presumed that calling the draw() method will render the same thing
as well. |
40 * | 41 * |
41 * Subclasses that change their state should call notifyDrawingChanged() to
ensure that | 42 * Subclasses that change their state should call notifyDrawingChanged() to
ensure that |
42 * a new value will be returned the next time it is called. | 43 * a new value will be returned the next time it is called. |
43 */ | 44 */ |
(...skipping 23 matching lines...) Expand all Loading... |
67 * of their drawable. Note: this picture must draw the same as what would b
e drawn from | 68 * of their drawable. Note: this picture must draw the same as what would b
e drawn from |
68 * onDraw(). | 69 * onDraw(). |
69 */ | 70 */ |
70 virtual SkPicture* onNewPictureSnapshot(); | 71 virtual SkPicture* onNewPictureSnapshot(); |
71 | 72 |
72 private: | 73 private: |
73 int32_t fGenerationID; | 74 int32_t fGenerationID; |
74 }; | 75 }; |
75 | 76 |
76 #endif | 77 #endif |
OLD | NEW |