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); |
36 | 43 |
37 /** 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 |
38 layers can be inside nested sub-pictures. | 45 layers can be inside nested sub-pictures. |
39 @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) |
40 @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 |
41 @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 |
42 @param query The rectangle that is about to be drawn. | 49 @param query The rectangle that is about to be drawn. |
43 @param atlasedNeedRendering Out parameter storing the layers that | 50 @param atlasedNeedRendering Out parameter storing the layers that |
44 should be hoisted to the atlas | 51 should be hoisted to the atlas |
45 @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 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 /** Update the GrTexture in 'layer' with its filtered version | 115 /** Update the GrTexture in 'layer' with its filtered version |
109 @param context Owner of the layer cache (and thus the layers) | 116 @param context Owner of the layer cache (and thus the layers) |
110 @param device Required by the filtering code | 117 @param device Required by the filtering code |
111 @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 |
112 */ | 119 */ |
113 static void FilterLayer(GrContext* context, SkGpuDevice* device, const GrHoi
stedLayer& info); | 120 static void FilterLayer(GrContext* context, SkGpuDevice* device, const GrHoi
stedLayer& info); |
114 | 121 |
115 }; | 122 }; |
116 | 123 |
117 #endif | 124 #endif |
OLD | NEW |