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 15 matching lines...) Expand all Loading... |
26 SkMatrix fLocalMat; | 26 SkMatrix fLocalMat; |
27 }; | 27 }; |
28 | 28 |
29 // This class collects the layer hoisting functionality in one place. | 29 // This class collects the layer hoisting functionality in one place. |
30 // For each picture rendering: | 30 // For each picture rendering: |
31 // FindLayersToHoist should be called once to collect the required layers | 31 // FindLayersToHoist should be called once to collect the required layers |
32 // DrawLayers should be called once to render them | 32 // DrawLayers should be called once to render them |
33 // UnlockLayers should be called once to allow the texture resources to be recy
cled | 33 // UnlockLayers should be called once to allow the texture resources to be recy
cled |
34 class GrLayerHoister { | 34 class GrLayerHoister { |
35 public: | 35 public: |
36 /** Attempt to reattach layers that may have been atlased in the past | |
37 */ | |
38 static void Begin(GrContext* context); | |
39 | |
40 /** Release cache resources | |
41 */ | |
42 static void End(GrContext* context); | |
43 | 36 |
44 /** Find the layers in 'topLevelPicture' that can be atlased. Note that the
discovered | 37 /** Find the layers in 'topLevelPicture' that can be atlased. Note that the
discovered |
45 layers can be inside nested sub-pictures. | 38 layers can be inside nested sub-pictures. |
46 @param context Owner of the layer cache (the source of new layers) | 39 @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 | 40 @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 | 41 @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. | 42 @param query The rectangle that is about to be drawn. |
50 @param atlasedNeedRendering Out parameter storing the layers that | 43 @param atlasedNeedRendering Out parameter storing the layers that |
51 should be hoisted to the atlas | 44 should be hoisted to the atlas |
52 @param recycled Out parameter storing layers that are atlased but do
not need rendering | 45 @param recycled Out parameter storing layers that are atlased but do
not need rendering |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 /** Update the GrTexture in 'layer' with its filtered version | 108 /** Update the GrTexture in 'layer' with its filtered version |
116 @param context Owner of the layer cache (and thus the layers) | 109 @param context Owner of the layer cache (and thus the layers) |
117 @param device Required by the filtering code | 110 @param device Required by the filtering code |
118 @param info Layer info for a layer needing filtering prior to bein
g composited | 111 @param info Layer info for a layer needing filtering prior to bein
g composited |
119 */ | 112 */ |
120 static void FilterLayer(GrContext* context, SkGpuDevice* device, const GrHoi
stedLayer& info); | 113 static void FilterLayer(GrContext* context, SkGpuDevice* device, const GrHoi
stedLayer& info); |
121 | 114 |
122 }; | 115 }; |
123 | 116 |
124 #endif | 117 #endif |
OLD | NEW |