| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 int opIndex) const; | 106 int opIndex) const; |
| 107 | 107 |
| 108 /* 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 |
| 109 * 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 |
| 110 * occurs. | 110 * occurs. |
| 111 */ | 111 */ |
| 112 static SkDrawCommand* fromJSON(Json::Value& command, UrlDataManager& urlData
Manager); | 112 static SkDrawCommand* fromJSON(Json::Value& command, UrlDataManager& urlData
Manager); |
| 113 | 113 |
| 114 static const char* GetCommandString(OpType type); | 114 static const char* GetCommandString(OpType type); |
| 115 | 115 |
| 116 // Helper methods for converting things to JSON |
| 117 static Json::Value MakeJsonIRect(const SkIRect&); |
| 118 static Json::Value MakeJsonMatrix(const SkMatrix&); |
| 119 |
| 116 protected: | 120 protected: |
| 117 SkTDArray<SkString*> fInfo; | 121 SkTDArray<SkString*> fInfo; |
| 118 | 122 |
| 119 private: | 123 private: |
| 120 OpType fOpType; | 124 OpType fOpType; |
| 121 bool fVisible; | 125 bool fVisible; |
| 122 }; | 126 }; |
| 123 | 127 |
| 124 class SkRestoreCommand : public SkDrawCommand { | 128 class SkRestoreCommand : public SkDrawCommand { |
| 125 public: | 129 public: |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 static SkSetMatrixCommand* fromJSON(Json::Value& command, UrlDataManager& ur
lDataManager); | 669 static SkSetMatrixCommand* fromJSON(Json::Value& command, UrlDataManager& ur
lDataManager); |
| 666 | 670 |
| 667 private: | 671 private: |
| 668 SkMatrix fUserMatrix; | 672 SkMatrix fUserMatrix; |
| 669 SkMatrix fMatrix; | 673 SkMatrix fMatrix; |
| 670 | 674 |
| 671 typedef SkDrawCommand INHERITED; | 675 typedef SkDrawCommand INHERITED; |
| 672 }; | 676 }; |
| 673 | 677 |
| 674 #endif | 678 #endif |
| OLD | NEW |