| 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 |
| 11 #include "png.h" | |
| 12 | |
| 13 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 14 #include "SkTLazy.h" | 12 #include "SkTLazy.h" |
| 15 #include "SkPath.h" | 13 #include "SkPath.h" |
| 16 #include "SkRRect.h" | 14 #include "SkRRect.h" |
| 17 #include "SkRSXform.h" | 15 #include "SkRSXform.h" |
| 18 #include "SkString.h" | 16 #include "SkString.h" |
| 19 #include "SkTDArray.h" | 17 #include "SkTDArray.h" |
| 20 #include "SkJSONCPP.h" | 18 #include "SkJSONCPP.h" |
| 21 #include "UrlDataManager.h" | 19 #include "UrlDataManager.h" |
| 22 | 20 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 kSave_OpType, | 56 kSave_OpType, |
| 59 kSaveLayer_OpType, | 57 kSaveLayer_OpType, |
| 60 kSetMatrix_OpType, | 58 kSetMatrix_OpType, |
| 61 kTranslateZ_OpType, | 59 kTranslateZ_OpType, |
| 62 | 60 |
| 63 kLast_OpType = kTranslateZ_OpType | 61 kLast_OpType = kTranslateZ_OpType |
| 64 }; | 62 }; |
| 65 | 63 |
| 66 static const int kOpTypeCount = kLast_OpType + 1; | 64 static const int kOpTypeCount = kLast_OpType + 1; |
| 67 | 65 |
| 68 static void WritePNG(const png_bytep rgba, png_uint_32 width, png_uint_32 he
ight, | 66 static void WritePNG(const uint8_t* rgba, unsigned width, unsigned height, |
| 69 SkWStream& out, bool isOpaque); | 67 SkWStream& out, bool isOpaque); |
| 70 | 68 |
| 71 SkDrawCommand(OpType opType); | 69 SkDrawCommand(OpType opType); |
| 72 | 70 |
| 73 virtual ~SkDrawCommand(); | 71 virtual ~SkDrawCommand(); |
| 74 | 72 |
| 75 virtual SkString toString() const; | 73 virtual SkString toString() const; |
| 76 | 74 |
| 77 virtual const char* toCString() const { | 75 virtual const char* toCString() const { |
| 78 return GetCommandString(fOpType); | 76 return GetCommandString(fOpType); |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 Json::Value toJSON(UrlDataManager& urlDataManager) const override; | 793 Json::Value toJSON(UrlDataManager& urlDataManager) const override; |
| 796 static SkTranslateZCommand* fromJSON(Json::Value& command, UrlDataManager& u
rlDataManager); | 794 static SkTranslateZCommand* fromJSON(Json::Value& command, UrlDataManager& u
rlDataManager); |
| 797 | 795 |
| 798 private: | 796 private: |
| 799 SkScalar fZTranslate; | 797 SkScalar fZTranslate; |
| 800 | 798 |
| 801 typedef SkDrawCommand INHERITED; | 799 typedef SkDrawCommand INHERITED; |
| 802 }; | 800 }; |
| 803 #endif | 801 #endif |
| 804 | 802 |
| OLD | NEW |