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 |
(...skipping 29 matching lines...) Expand all Loading... |
40 /** Release cache resources | 40 /** Release cache resources |
41 */ | 41 */ |
42 static void End(GrContext* context); | 42 static void End(GrContext* context); |
43 | 43 |
44 /** Find the layers in 'topLevelPicture' that can be atlased. Note that the
discovered | 44 /** Find the layers in 'topLevelPicture' that can be atlased. Note that the
discovered |
45 layers can be inside nested sub-pictures. | 45 layers can be inside nested sub-pictures. |
46 @param context Owner of the layer cache (the source of new layers) | 46 @param context Owner of the layer cache (the source of new layers) |
47 @param topLevelPicture The top-level picture that is about to be rendere
d | 47 @param topLevelPicture The top-level picture that is about to be rendere
d |
48 @param initialMat The CTM of the canvas into which the layers will be d
rawn | 48 @param initialMat The CTM of the canvas into which the layers will be d
rawn |
49 @param query The rectangle that is about to be drawn. | 49 @param query The rectangle that is about to be drawn. |
50 @param atlasedNeedRendering Out parameter storing the layers that | 50 @param atlasedNeedRendering Out parameter storing the layers that |
51 should be hoisted to the atlas | 51 should be hoisted to the atlas |
52 @param recycled Out parameter storing layers that are atlased but do
not need rendering | 52 @param recycled Out parameter storing layers that are atlased but do
not need rendering |
53 @param numSamples The number if MSAA samples required | 53 @param numSamples The number if MSAA samples required |
54 */ | 54 */ |
55 static void FindLayersToAtlas(GrContext* context, | 55 static void FindLayersToAtlas(GrContext* context, |
56 const SkPicture* topLevelPicture, | 56 const SkPicture* topLevelPicture, |
57 const SkMatrix& initialMat, | 57 const SkMatrix& initialMat, |
58 const SkRect& query, | 58 const SkRect& query, |
59 SkTDArray<GrHoistedLayer>* atlasedNeedRenderin
g, | 59 SkTDArray<GrHoistedLayer>* atlasedNeedRenderin
g, |
60 SkTDArray<GrHoistedLayer>* recycled, | 60 SkTDArray<GrHoistedLayer>* recycled, |
(...skipping 27 matching lines...) Expand all Loading... |
88 /** Draw the specified layers into their own individual textures. | 88 /** Draw the specified layers into their own individual textures. |
89 @param context Owner of the layer cache (and thus the layers) | 89 @param context Owner of the layer cache (and thus the layers) |
90 @param layers The layers to be drawn | 90 @param layers The layers to be drawn |
91 */ | 91 */ |
92 static void DrawLayers(GrContext* context, const SkTDArray<GrHoistedLayer>&
layers); | 92 static void DrawLayers(GrContext* context, const SkTDArray<GrHoistedLayer>&
layers); |
93 | 93 |
94 /** Convert all the layers in 'layers' into replacement objects in 'replacem
ents'. | 94 /** Convert all the layers in 'layers' into replacement objects in 'replacem
ents'. |
95 @param layers The hoisted layers | 95 @param layers The hoisted layers |
96 @param replacements Replacement object that will be used for a replaceme
nt draw | 96 @param replacements Replacement object that will be used for a replaceme
nt draw |
97 */ | 97 */ |
98 static void ConvertLayersToReplacements(const SkPicture* topLevelPicture, | 98 static void ConvertLayersToReplacements(const SkPicture* topLevelPicture, |
99 const SkTDArray<GrHoistedLayer>& lay
ers, | 99 const SkTDArray<GrHoistedLayer>& lay
ers, |
100 GrReplacements* replacements); | 100 GrReplacements* replacements); |
101 | 101 |
102 /** Unlock a group of layers in the layer cache. | 102 /** Unlock a group of layers in the layer cache. |
103 @param context Owner of the layer cache (and thus the layers) | 103 @param context Owner of the layer cache (and thus the layers) |
104 @param layers Unneeded layers in the atlas | 104 @param layers Unneeded layers in the atlas |
105 */ | 105 */ |
106 static void UnlockLayers(GrContext* context, const SkTDArray<GrHoistedLayer>
& layers); | 106 static void UnlockLayers(GrContext* context, const SkTDArray<GrHoistedLayer>
& layers); |
107 | 107 |
108 /** Forceably remove all cached layers and release the atlas. Useful for deb
ugging and timing. | 108 /** Forceably remove all cached layers and release the atlas. Useful for deb
ugging and timing. |
109 This is only functional when GR_CACHE_HOISTED_LAYERS is set to 1 in GrLa
yerCache.h | 109 This is only functional when GR_CACHE_HOISTED_LAYERS is set to 1 in GrLa
yerCache.h |
110 @param context Owner of the layer cache (and thus the layers) | 110 @param context Owner of the layer cache (and thus the layers) |
111 */ | 111 */ |
112 static void PurgeCache(GrContext* context); | 112 static void PurgeCache(GrContext* context); |
113 | 113 |
114 private: | 114 private: |
115 /** Update the GrTexture in 'layer' with its filtered version | 115 /** Update the GrTexture in 'layer' with its filtered version |
116 @param context Owner of the layer cache (and thus the layers) | 116 @param context Owner of the layer cache (and thus the layers) |
117 @param device Required by the filtering code | 117 @param device Required by the filtering code |
118 @param info Layer info for a layer needing filtering prior to bein
g composited | 118 @param info Layer info for a layer needing filtering prior to bein
g composited |
119 */ | 119 */ |
120 static void FilterLayer(GrContext* context, SkGpuDevice* device, const GrHoi
stedLayer& info); | 120 static void FilterLayer(GrContext* context, SkGpuDevice* device, const GrHoi
stedLayer& info); |
121 | 121 |
122 }; | 122 }; |
123 | 123 |
124 #endif | 124 #endif |
OLD | NEW |