| 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 GrLayerHoister_DEFINED | 8 #ifndef GrLayerHoister_DEFINED |
| 9 #define GrLayerHoister_DEFINED | 9 #define GrLayerHoister_DEFINED |
| 10 | 10 |
| 11 #include "SkPicture.h" | 11 #include "SkPicture.h" |
| 12 #include "SkTDArray.h" | 12 #include "SkTDArray.h" |
| 13 | 13 |
| 14 struct GrCachedLayer; | 14 struct GrCachedLayer; |
| 15 class GrReplacements; | 15 class GrReplacements; |
| 16 class SkGpuDevice; |
| 16 struct SkRect; | 17 struct SkRect; |
| 17 | 18 |
| 18 class GrHoistedLayer { | 19 class GrHoistedLayer { |
| 19 public: | 20 public: |
| 20 const SkPicture* fPicture; // the picture that actually contains the layer | 21 const SkPicture* fPicture; // the picture that actually contains the layer |
| 21 // (not necessarily the top-most picture) | 22 // (not necessarily the top-most picture) |
| 22 GrCachedLayer* fLayer; | 23 GrCachedLayer* fLayer; |
| 23 SkMatrix fInitialMat; | 24 SkMatrix fInitialMat; |
| 24 SkMatrix fPreMat; | 25 SkMatrix fPreMat; |
| 25 SkMatrix fLocalMat; | 26 SkMatrix fLocalMat; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 @param context Owner of the layer cache (and thus the layers) | 96 @param context Owner of the layer cache (and thus the layers) |
| 96 @param layers Unneeded layers in the atlas | 97 @param layers Unneeded layers in the atlas |
| 97 */ | 98 */ |
| 98 static void UnlockLayers(GrContext* context, const SkTDArray<GrHoistedLayer>
& layers); | 99 static void UnlockLayers(GrContext* context, const SkTDArray<GrHoistedLayer>
& layers); |
| 99 | 100 |
| 100 /** Forceably remove all cached layers and release the atlas. Useful for deb
ugging and timing. | 101 /** Forceably remove all cached layers and release the atlas. Useful for deb
ugging and timing. |
| 101 This is only functional when GR_CACHE_HOISTED_LAYERS is set to 1 in GrLa
yerCache.h | 102 This is only functional when GR_CACHE_HOISTED_LAYERS is set to 1 in GrLa
yerCache.h |
| 102 @param context Owner of the layer cache (and thus the layers) | 103 @param context Owner of the layer cache (and thus the layers) |
| 103 */ | 104 */ |
| 104 static void PurgeCache(GrContext* context); | 105 static void PurgeCache(GrContext* context); |
| 106 |
| 107 private: |
| 108 /** Update the GrTexture in 'layer' with its filtered version |
| 109 @param context Owner of the layer cache (and thus the layers) |
| 110 @param device Required by the filtering code |
| 111 @param layer A layer needing filtering prior to being composited |
| 112 */ |
| 113 static void FilterLayer(GrContext* context, SkGpuDevice* device, GrCachedLay
er* layer); |
| 114 |
| 105 }; | 115 }; |
| 106 | 116 |
| 107 #endif | 117 #endif |
| OLD | NEW |