| 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 |
| 11 #include "SkCanvas.h" | 13 #include "SkCanvas.h" |
| 12 #include "SkTLazy.h" | 14 #include "SkTLazy.h" |
| 13 #include "SkPath.h" | 15 #include "SkPath.h" |
| 14 #include "SkRRect.h" | 16 #include "SkRRect.h" |
| 15 #include "SkString.h" | 17 #include "SkString.h" |
| 16 #include "SkTDArray.h" | 18 #include "SkTDArray.h" |
| 17 #include "SkJSONCPP.h" | 19 #include "SkJSONCPP.h" |
| 18 #include "UrlDataManager.h" | 20 #include "UrlDataManager.h" |
| 19 | 21 |
| 20 class SK_API SkDrawCommand { | 22 class SK_API SkDrawCommand { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 50 kRestore_OpType, | 52 kRestore_OpType, |
| 51 kSave_OpType, | 53 kSave_OpType, |
| 52 kSaveLayer_OpType, | 54 kSaveLayer_OpType, |
| 53 kSetMatrix_OpType, | 55 kSetMatrix_OpType, |
| 54 | 56 |
| 55 kLast_OpType = kSetMatrix_OpType | 57 kLast_OpType = kSetMatrix_OpType |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 static const int kOpTypeCount = kLast_OpType + 1; | 60 static const int kOpTypeCount = kLast_OpType + 1; |
| 59 | 61 |
| 62 static void WritePNG(const png_bytep rgba, png_uint_32 width, png_uint_32 he
ight, |
| 63 SkWStream& out); |
| 64 |
| 60 SkDrawCommand(OpType opType); | 65 SkDrawCommand(OpType opType); |
| 61 | 66 |
| 62 virtual ~SkDrawCommand(); | 67 virtual ~SkDrawCommand(); |
| 63 | 68 |
| 64 virtual SkString toString() const; | 69 virtual SkString toString() const; |
| 65 | 70 |
| 66 virtual const char* toCString() const { | 71 virtual const char* toCString() const { |
| 67 return GetCommandString(fOpType); | 72 return GetCommandString(fOpType); |
| 68 } | 73 } |
| 69 | 74 |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 static SkSetMatrixCommand* fromJSON(Json::Value& command, UrlDataManager& ur
lDataManager); | 673 static SkSetMatrixCommand* fromJSON(Json::Value& command, UrlDataManager& ur
lDataManager); |
| 669 | 674 |
| 670 private: | 675 private: |
| 671 SkMatrix fUserMatrix; | 676 SkMatrix fUserMatrix; |
| 672 SkMatrix fMatrix; | 677 SkMatrix fMatrix; |
| 673 | 678 |
| 674 typedef SkDrawCommand INHERITED; | 679 typedef SkDrawCommand INHERITED; |
| 675 }; | 680 }; |
| 676 | 681 |
| 677 #endif | 682 #endif |
| OLD | NEW |