| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef SKDRAWCOMMAND_H_ | 9 #ifndef SKDRAWCOMMAND_H_ |
| 10 #define SKDRAWCOMMAND_H_ | 10 #define SKDRAWCOMMAND_H_ |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 static const int kOpTypeCount = kLast_OpType + 1; | 54 static const int kOpTypeCount = kLast_OpType + 1; |
| 55 | 55 |
| 56 SkDrawCommand(OpType opType); | 56 SkDrawCommand(OpType opType); |
| 57 | 57 |
| 58 virtual ~SkDrawCommand(); | 58 virtual ~SkDrawCommand(); |
| 59 | 59 |
| 60 virtual SkString toString() const; | 60 virtual SkString toString() const; |
| 61 | 61 |
| 62 void setOffset(size_t offset) { fOffset = offset; } | |
| 63 size_t offset() const { return fOffset; } | |
| 64 | |
| 65 virtual const char* toCString() const { | 62 virtual const char* toCString() const { |
| 66 return GetCommandString(fOpType); | 63 return GetCommandString(fOpType); |
| 67 } | 64 } |
| 68 | 65 |
| 69 bool isVisible() const { | 66 bool isVisible() const { |
| 70 return fVisible; | 67 return fVisible; |
| 71 } | 68 } |
| 72 | 69 |
| 73 void setVisible(bool toggle) { | 70 void setVisible(bool toggle) { |
| 74 fVisible = toggle; | 71 fVisible = toggle; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 99 | 96 |
| 100 virtual bool render(SkCanvas* canvas) const { return false; } | 97 virtual bool render(SkCanvas* canvas) const { return false; } |
| 101 | 98 |
| 102 static const char* GetCommandString(OpType type); | 99 static const char* GetCommandString(OpType type); |
| 103 | 100 |
| 104 protected: | 101 protected: |
| 105 SkTDArray<SkString*> fInfo; | 102 SkTDArray<SkString*> fInfo; |
| 106 | 103 |
| 107 private: | 104 private: |
| 108 OpType fOpType; | 105 OpType fOpType; |
| 109 size_t fOffset; | |
| 110 bool fVisible; | 106 bool fVisible; |
| 111 }; | 107 }; |
| 112 | 108 |
| 113 class SkRestoreCommand : public SkDrawCommand { | 109 class SkRestoreCommand : public SkDrawCommand { |
| 114 public: | 110 public: |
| 115 SkRestoreCommand(); | 111 SkRestoreCommand(); |
| 116 void execute(SkCanvas* canvas) const override; | 112 void execute(SkCanvas* canvas) const override; |
| 117 Action action() const override { return kPopLayer_Action; } | 113 Action action() const override { return kPopLayer_Action; } |
| 118 | 114 |
| 119 private: | 115 private: |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 void setUserMatrix(const SkMatrix&) override; | 582 void setUserMatrix(const SkMatrix&) override; |
| 587 void execute(SkCanvas* canvas) const override; | 583 void execute(SkCanvas* canvas) const override; |
| 588 private: | 584 private: |
| 589 SkMatrix fUserMatrix; | 585 SkMatrix fUserMatrix; |
| 590 SkMatrix fMatrix; | 586 SkMatrix fMatrix; |
| 591 | 587 |
| 592 typedef SkDrawCommand INHERITED; | 588 typedef SkDrawCommand INHERITED; |
| 593 }; | 589 }; |
| 594 | 590 |
| 595 #endif | 591 #endif |
| OLD | NEW |