| 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 GrPictureUtils_DEFINED | 8 #ifndef GrPictureUtils_DEFINED |
| 9 #define GrPictureUtils_DEFINED | 9 #define GrPictureUtils_DEFINED |
| 10 | 10 |
| 11 #include "SkPicture.h" | 11 #include "SkPicture.h" |
| 12 #include "SkTDArray.h" | 12 #include "SkTDArray.h" |
| 13 | 13 |
| 14 // This class encapsulates the GPU-backend-specific acceleration data | 14 // This class encapsulates the GPU-backend-specific acceleration data |
| 15 // for a single SkPicture | 15 // for a single SkPicture |
| 16 class GPUAccelData : public SkPicture::AccelData { | 16 class GPUAccelData : public SkPicture::AccelData { |
| 17 public: | 17 public: |
| 18 // Information about a given saveLayer in an SkPicture | 18 // Information about a given saveLayer in an SkPicture |
| 19 struct SaveLayerInfo { | 19 struct SaveLayerInfo { |
| 20 // The size of the saveLayer | 20 // The size of the saveLayer |
| 21 SkISize fSize; | 21 SkISize fSize; |
| 22 // The origin of this layer in the parent layer |
| 23 SkIPoint fOrigin; |
| 24 // The paint to use on restore |
| 25 const SkPaint* fPaint; |
| 22 // The ID of this saveLayer in the picture. 0 is an invalid ID. | 26 // The ID of this saveLayer in the picture. 0 is an invalid ID. |
| 23 size_t fSaveLayerOpID; | 27 size_t fSaveLayerOpID; |
| 24 // The ID of the matching restore in the picture. 0 is an invalid ID. | 28 // The ID of the matching restore in the picture. 0 is an invalid ID. |
| 25 size_t fRestoreOpID; | 29 size_t fRestoreOpID; |
| 26 // True if this saveLayer has at least one other saveLayer nested within
it. | 30 // True if this saveLayer has at least one other saveLayer nested within
it. |
| 27 // False otherwise. | 31 // False otherwise. |
| 28 bool fHasNestedLayers; | 32 bool fHasNestedLayers; |
| 29 }; | 33 }; |
| 30 | 34 |
| 31 GPUAccelData(Key key) : INHERITED(key) { } | 35 GPUAccelData(Key key) : INHERITED(key) { } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 46 protected: | 50 protected: |
| 47 SkTDArray<SaveLayerInfo> fSaveLayerInfo; | 51 SkTDArray<SaveLayerInfo> fSaveLayerInfo; |
| 48 | 52 |
| 49 private: | 53 private: |
| 50 typedef SkPicture::AccelData INHERITED; | 54 typedef SkPicture::AccelData INHERITED; |
| 51 }; | 55 }; |
| 52 | 56 |
| 53 void GatherGPUInfo(SkPicture* pict, GPUAccelData* accelData); | 57 void GatherGPUInfo(SkPicture* pict, GPUAccelData* accelData); |
| 54 | 58 |
| 55 #endif // GrPictureUtils_DEFINED | 59 #endif // GrPictureUtils_DEFINED |
| OLD | NEW |