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, | |
106 int opIndex) const; | |
107 | |
108 /* Converts a JSON representation of a command into a newly-allocated SkDraw
Command object. It | 105 /* Converts a JSON representation of a command into a newly-allocated SkDraw
Command object. It |
109 * is the caller's responsibility to delete this object. This method may ret
urn null if an error | 106 * is the caller's responsibility to delete this object. This method may ret
urn null if an error |
110 * occurs. | 107 * occurs. |
111 */ | 108 */ |
112 static SkDrawCommand* fromJSON(Json::Value& command, UrlDataManager& urlData
Manager); | 109 static SkDrawCommand* fromJSON(Json::Value& command, UrlDataManager& urlData
Manager); |
113 | 110 |
114 static const char* GetCommandString(OpType type); | 111 static const char* GetCommandString(OpType type); |
115 | 112 |
116 // Helper methods for converting things to JSON | 113 // Helper methods for converting things to JSON |
117 static Json::Value MakeJsonIRect(const SkIRect&); | 114 static Json::Value MakeJsonIRect(const SkIRect&); |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 static SkSetMatrixCommand* fromJSON(Json::Value& command, UrlDataManager& ur
lDataManager); | 666 static SkSetMatrixCommand* fromJSON(Json::Value& command, UrlDataManager& ur
lDataManager); |
670 | 667 |
671 private: | 668 private: |
672 SkMatrix fUserMatrix; | 669 SkMatrix fUserMatrix; |
673 SkMatrix fMatrix; | 670 SkMatrix fMatrix; |
674 | 671 |
675 typedef SkDrawCommand INHERITED; | 672 typedef SkDrawCommand INHERITED; |
676 }; | 673 }; |
677 | 674 |
678 #endif | 675 #endif |
OLD | NEW |