Index: src/gpu/GrLayerHoister.h |
diff --git a/src/gpu/GrLayerHoister.h b/src/gpu/GrLayerHoister.h |
index a3b97e328a2183a7ddffe1053d36a5fe4aadc39c..3de8c0dc11a151f44fe456b52e50c013acd05b17 100644 |
--- a/src/gpu/GrLayerHoister.h |
+++ b/src/gpu/GrLayerHoister.h |
@@ -23,37 +23,43 @@ struct SkRect; |
// UnlockLayers should be called once to allow the texture resources to be recycled |
class GrLayerHoister { |
public: |
- /** Find the layers in 'gpuData' that need hoisting. |
- @param gpuData Acceleration structure containing layer information for a picture |
- @param query The rectangle that is about to be drawn. |
- @param atlased Out parameter storing the layers that should be hoisted to the atlas |
- @param nonAtlased Out parameter storing the layers that should be hoisted stand alone |
+ struct HoistingInfo { |
bsalomon
2014/09/23 14:57:35
I can't think of anything much better but this nam
robertphillips
2014/09/24 14:49:04
Done. Went with HoistedLayer.
|
+ const SkPicture* picture; |
+ GrCachedLayer* layer; |
+ }; |
+ |
+ /** Find the layers in 'mainPicture' that need hoisting. Note that the discovered |
bsalomon
2014/09/23 14:57:35
"topLevel", "root", or "base" seem clearer to me t
robertphillips
2014/09/24 14:49:03
Done. Went with topLevel.
|
+ layers can be inside nested sub-pictures. |
+ @param mainPicture The top-level picture that is about to be rendered |
+ @param query The rectangle that is about to be drawn. |
+ @param atlased Out parameter storing the layers that should be hoisted to the atlas |
+ @param nonAtlased Out parameter storing the layers that should be hoisted stand alone |
@param layerCache The source of new layers |
Return true if any layers are suitable for hoisting; false otherwise |
*/ |
- static bool FindLayersToHoist(const GrAccelData *gpuData, |
+ static bool FindLayersToHoist(const SkPicture* mainPicture, |
const SkRect& query, |
- SkTDArray<GrCachedLayer*>* altased, |
- SkTDArray<GrCachedLayer*>* nonAtlased, |
+ SkTDArray<HoistingInfo>* altased, |
+ SkTDArray<HoistingInfo>* nonAtlased, |
GrLayerCache* layerCache); |
- /** Draw the specified layers of 'picture' into either the atlas or free |
- floating textures. |
- @param picture The picture containing the layers |
+ /** Draw the specified layers into either the atlas or free floating textures. |
@param atlased The layers to be drawn into the atlas |
@param nonAtlased The layers to be drawn into their own textures |
@oaram replacements The replacement structure to fill in with the rendered layer info |
*/ |
- static void DrawLayers(const SkPicture* picture, |
- const SkTDArray<GrCachedLayer*>& atlased, |
- const SkTDArray<GrCachedLayer*>& nonAtlased, |
+ static void DrawLayers(const SkTDArray<HoistingInfo>& atlased, |
+ const SkTDArray<HoistingInfo>& nonAtlased, |
GrReplacements* replacements); |
- /** Unlock all the layers associated with picture in the layer cache. |
+ /** Unlock unneeded layers in the layer cache. |
@param layerCache holder of the locked layers |
- @pmara picture the source of the locked layers |
+ @param atlased Unneeded layers in the atlas |
+ @param nonAtlased Unneeded layers in their own textures |
*/ |
- static void UnlockLayers(GrLayerCache* layerCache, const SkPicture* picture); |
+ static void UnlockLayers(GrLayerCache* layerCache, |
+ const SkTDArray<HoistingInfo>& atlased, |
+ const SkTDArray<HoistingInfo>& nonAtlased); |
}; |
#endif |