| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkLayerInfo_DEFINED | 8 #ifndef SkLayerInfo_DEFINED |
| 9 #define SkLayerInfo_DEFINED | 9 #define SkLayerInfo_DEFINED |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // The index of the matching restore in the picture. | 46 // The index of the matching restore in the picture. |
| 47 size_t fRestoreOpID; | 47 size_t fRestoreOpID; |
| 48 // True if this saveLayer has at least one other saveLayer nested within
it. | 48 // True if this saveLayer has at least one other saveLayer nested within
it. |
| 49 // False otherwise. | 49 // False otherwise. |
| 50 bool fHasNestedLayers; | 50 bool fHasNestedLayers; |
| 51 // True if this saveLayer is nested within another. False otherwise. | 51 // True if this saveLayer is nested within another. False otherwise. |
| 52 bool fIsNested; | 52 bool fIsNested; |
| 53 // The variable length key for this saveLayer block. It stores the | 53 // The variable length key for this saveLayer block. It stores the |
| 54 // thread of drawPicture and saveLayer operation indices that lead to th
is | 54 // thread of drawPicture and saveLayer operation indices that lead to th
is |
| 55 // saveLayer (including its own op index). The BlockInfo owns this memor
y. | 55 // saveLayer (including its own op index). The BlockInfo owns this memor
y. |
| 56 int* fKey; | 56 unsigned* fKey; |
| 57 int fKeySize; // # of ints | 57 int fKeySize; // # of ints |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 SkLayerInfo(Key key) : INHERITED(key) { } | 60 SkLayerInfo(Key key) : INHERITED(key) { } |
| 61 | 61 |
| 62 BlockInfo& addBlock() { return fBlocks.push_back(); } | 62 BlockInfo& addBlock() { return fBlocks.push_back(); } |
| 63 | 63 |
| 64 int numBlocks() const { return fBlocks.count(); } | 64 int numBlocks() const { return fBlocks.count(); } |
| 65 | 65 |
| 66 const BlockInfo& block(int index) const { | 66 const BlockInfo& block(int index) const { |
| 67 SkASSERT(index < fBlocks.count()); | 67 SkASSERT(index < fBlocks.count()); |
| 68 | 68 |
| 69 return fBlocks[index]; | 69 return fBlocks[index]; |
| 70 } | 70 } |
| 71 | 71 |
| 72 // We may, in the future, need to pass in the GPUDevice in order to | 72 // We may, in the future, need to pass in the GPUDevice in order to |
| 73 // incorporate the clip and matrix state into the key | 73 // incorporate the clip and matrix state into the key |
| 74 static SkPicture::AccelData::Key ComputeKey(); | 74 static SkPicture::AccelData::Key ComputeKey(); |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 SkTArray<BlockInfo, true> fBlocks; | 77 SkTArray<BlockInfo, true> fBlocks; |
| 78 | 78 |
| 79 typedef SkPicture::AccelData INHERITED; | 79 typedef SkPicture::AccelData INHERITED; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 #endif // SkLayerInfo_DEFINED | 82 #endif // SkLayerInfo_DEFINED |
| OLD | NEW |