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 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 | 35 |
36 /** Find the layers in 'topLevelPicture' that can be atlased. Note that the
discovered | 36 /** Find the layers in 'topLevelPicture' that can be atlased. Note that the
discovered |
37 layers can be inside nested sub-pictures. | 37 layers can be inside nested sub-pictures. |
38 @param context Owner of the layer cache (the source of new layers) | 38 @param context Owner of the layer cache (the source of new layers) |
39 @param topLevelPicture The top-level picture that is about to be rendere
d | 39 @param topLevelPicture The top-level picture that is about to be rendere
d |
40 @param query The rectangle that is about to be drawn. | 40 @param query The rectangle that is about to be drawn. |
41 @param atlasedNeedRendering Out parameter storing the layers that | 41 @param atlasedNeedRendering Out parameter storing the layers that |
42 should be hoisted to the atlas | 42 should be hoisted to the atlas |
43 @param recycled Out parameter storing layers that are atlased but do
not need rendering | 43 @param recycled Out parameter storing layers that are atlased but do
not need rendering |
| 44 @param numSamples The number if MSAA samples required |
44 */ | 45 */ |
45 static void FindLayersToAtlas(GrContext* context, | 46 static void FindLayersToAtlas(GrContext* context, |
46 const SkPicture* topLevelPicture, | 47 const SkPicture* topLevelPicture, |
47 const SkRect& query, | 48 const SkRect& query, |
48 SkTDArray<GrHoistedLayer>* atlasedNeedRenderin
g, | 49 SkTDArray<GrHoistedLayer>* atlasedNeedRenderin
g, |
49 SkTDArray<GrHoistedLayer>* recycled); | 50 SkTDArray<GrHoistedLayer>* recycled, |
| 51 int numSamples); |
50 | 52 |
51 /** Find the layers in 'topLevelPicture' that need hoisting. Note that the d
iscovered | 53 /** Find the layers in 'topLevelPicture' that need hoisting. Note that the d
iscovered |
52 layers can be inside nested sub-pictures. | 54 layers can be inside nested sub-pictures. |
53 @param context Owner of the layer cache (the source of new layers) | 55 @param context Owner of the layer cache (the source of new layers) |
54 @param topLevelPicture The top-level picture that is about to be rendere
d | 56 @param topLevelPicture The top-level picture that is about to be rendere
d |
55 @param query The rectangle that is about to be drawn. | 57 @param query The rectangle that is about to be drawn. |
56 @param needRendering Out parameter storing the layers that need renderin
g. | 58 @param needRendering Out parameter storing the layers that need renderin
g. |
57 This should never include atlased layers. | 59 This should never include atlased layers. |
58 @param recycled Out parameter storing layers that need hoisting but n
ot rendering | 60 @param recycled Out parameter storing layers that need hoisting but n
ot rendering |
| 61 @param numSamples The number if MSAA samples required |
59 */ | 62 */ |
60 static void FindLayersToHoist(GrContext* context, | 63 static void FindLayersToHoist(GrContext* context, |
61 const SkPicture* topLevelPicture, | 64 const SkPicture* topLevelPicture, |
62 const SkRect& query, | 65 const SkRect& query, |
63 SkTDArray<GrHoistedLayer>* needRendering, | 66 SkTDArray<GrHoistedLayer>* needRendering, |
64 SkTDArray<GrHoistedLayer>* recycled); | 67 SkTDArray<GrHoistedLayer>* recycled, |
| 68 int numSamples); |
65 | 69 |
66 /** Draw the specified layers into the atlas. | 70 /** Draw the specified layers into the atlas. |
67 @param context Owner of the layer cache (and thus the layers) | 71 @param context Owner of the layer cache (and thus the layers) |
68 @param layers The layers to be drawn into the atlas | 72 @param layers The layers to be drawn into the atlas |
69 */ | 73 */ |
70 static void DrawLayersToAtlas(GrContext* context, const SkTDArray<GrHoistedL
ayer>& layers); | 74 static void DrawLayersToAtlas(GrContext* context, const SkTDArray<GrHoistedL
ayer>& layers); |
71 | 75 |
72 /** Draw the specified layers into their own individual textures. | 76 /** Draw the specified layers into their own individual textures. |
73 @param context Owner of the layer cache (and thus the layers) | 77 @param context Owner of the layer cache (and thus the layers) |
74 @param layers The layers to be drawn | 78 @param layers The layers to be drawn |
(...skipping 14 matching lines...) Expand all Loading... |
89 static void UnlockLayers(GrContext* context, const SkTDArray<GrHoistedLayer>
& layers); | 93 static void UnlockLayers(GrContext* context, const SkTDArray<GrHoistedLayer>
& layers); |
90 | 94 |
91 /** Forceably remove all cached layers and release the atlas. Useful for deb
ugging and timing. | 95 /** Forceably remove all cached layers and release the atlas. Useful for deb
ugging and timing. |
92 This is only functional when GR_CACHE_HOISTED_LAYERS is set to 1 in GrLa
yerCache.h | 96 This is only functional when GR_CACHE_HOISTED_LAYERS is set to 1 in GrLa
yerCache.h |
93 @param context Owner of the layer cache (and thus the layers) | 97 @param context Owner of the layer cache (and thus the layers) |
94 */ | 98 */ |
95 static void PurgeCache(GrContext* context); | 99 static void PurgeCache(GrContext* context); |
96 }; | 100 }; |
97 | 101 |
98 #endif | 102 #endif |
OLD | NEW |