OLD | NEW |
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 #ifndef SKDRAWCOMMAND_H_ | 8 #ifndef SKDRAWCOMMAND_H_ |
9 #define SKDRAWCOMMAND_H_ | 9 #define SKDRAWCOMMAND_H_ |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 virtual Action action() const { return kNone_Action; } | 95 virtual Action action() const { return kNone_Action; } |
96 virtual void setActive(bool active) {} | 96 virtual void setActive(bool active) {} |
97 virtual bool active() const { return false; } | 97 virtual bool active() const { return false; } |
98 | 98 |
99 OpType getType() const { return fOpType; } | 99 OpType getType() const { return fOpType; } |
100 | 100 |
101 virtual bool render(SkCanvas* canvas) const { return false; } | 101 virtual bool render(SkCanvas* canvas) const { return false; } |
102 | 102 |
103 virtual Json::Value toJSON(UrlDataManager& urlDataManager) const; | 103 virtual Json::Value toJSON(UrlDataManager& urlDataManager) const; |
104 | 104 |
105 Json::Value drawToAndCollectJSON(SkCanvas*, UrlDataManager& urlDataManager)
const; | 105 Json::Value drawToAndCollectJSON(SkCanvas*, UrlDataManager& urlDataManager, |
| 106 int opIndex) const; |
106 | 107 |
107 /* Converts a JSON representation of a command into a newly-allocated SkDraw
Command object. It | 108 /* Converts a JSON representation of a command into a newly-allocated SkDraw
Command object. It |
108 * is the caller's responsibility to delete this object. This method may ret
urn null if an error | 109 * is the caller's responsibility to delete this object. This method may ret
urn null if an error |
109 * occurs. | 110 * occurs. |
110 */ | 111 */ |
111 static SkDrawCommand* fromJSON(Json::Value& command, UrlDataManager& urlData
Manager); | 112 static SkDrawCommand* fromJSON(Json::Value& command, UrlDataManager& urlData
Manager); |
112 | 113 |
113 static const char* GetCommandString(OpType type); | 114 static const char* GetCommandString(OpType type); |
114 | 115 |
115 protected: | 116 protected: |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 static SkSetMatrixCommand* fromJSON(Json::Value& command, UrlDataManager& ur
lDataManager); | 665 static SkSetMatrixCommand* fromJSON(Json::Value& command, UrlDataManager& ur
lDataManager); |
665 | 666 |
666 private: | 667 private: |
667 SkMatrix fUserMatrix; | 668 SkMatrix fUserMatrix; |
668 SkMatrix fMatrix; | 669 SkMatrix fMatrix; |
669 | 670 |
670 typedef SkDrawCommand INHERITED; | 671 typedef SkDrawCommand INHERITED; |
671 }; | 672 }; |
672 | 673 |
673 #endif | 674 #endif |
OLD | NEW |