Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: src/gpu/GrLayerHoister.h

Issue 533673002: Expose layer hoisting API in GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix No GPU build Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkMultiPictureDraw.cpp ('k') | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerHoister.h
diff --git a/src/gpu/GrLayerHoister.h b/src/gpu/GrLayerHoister.h
index 58b3f4870ba2f809a1a3554a1b50216eebd22b5f..7f49881e21d66194a7f199cb32f9a54a8e9d3cb6 100644
--- a/src/gpu/GrLayerHoister.h
+++ b/src/gpu/GrLayerHoister.h
@@ -16,6 +16,14 @@ struct GrCachedLayer;
class GrReplacements;
struct SkRect;
+class GrHoistedLayer {
+public:
+ const SkPicture* fPicture;
+ GrCachedLayer* fLayer;
+ SkIPoint fOffset;
+ SkMatrix fCTM;
+};
+
// This class collects the layer hoisting functionality in one place.
// For each picture rendering:
// FindLayersToHoist should be called once to collect the required layers
@@ -23,29 +31,23 @@ struct SkRect;
// UnlockLayers should be called once to allow the texture resources to be recycled
class GrLayerHoister {
public:
- struct HoistedLayer {
- const SkPicture* fPicture;
- GrCachedLayer* fLayer;
- SkIPoint fOffset;
- SkMatrix fCTM;
- };
/** Find the layers in 'topLevelPicture' that need hoisting. Note that the discovered
layers can be inside nested sub-pictures.
+ @param context Owner of the layer cache (the source of new layers)
@param topLevelPicture 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 recycled Out parameter storing layers that need hoisting but not rendering
- @param layerCache The source of new layers
Return true if any layers are suitable for hoisting; false otherwise
*/
- static bool FindLayersToHoist(const SkPicture* topLevelPicture,
+ static bool FindLayersToHoist(GrContext* context,
+ const SkPicture* topLevelPicture,
const SkRect& query,
- SkTDArray<HoistedLayer>* altased,
- SkTDArray<HoistedLayer>* nonAtlased,
- SkTDArray<HoistedLayer>* recycled,
- GrLayerCache* layerCache);
+ SkTDArray<GrHoistedLayer>* atlased,
+ SkTDArray<GrHoistedLayer>* nonAtlased,
+ SkTDArray<GrHoistedLayer>* recycled);
/** Draw the specified layers into either the atlas or free floating textures.
@param atlased The layers to be drawn into the atlas
@@ -54,21 +56,21 @@ public:
replacements object
@param replacements The replacement structure to fill in with the rendered layer info
*/
- static void DrawLayers(const SkTDArray<HoistedLayer>& atlased,
- const SkTDArray<HoistedLayer>& nonAtlased,
- const SkTDArray<HoistedLayer>& recycled,
+ static void DrawLayers(const SkTDArray<GrHoistedLayer>& atlased,
+ const SkTDArray<GrHoistedLayer>& nonAtlased,
+ const SkTDArray<GrHoistedLayer>& recycled,
GrReplacements* replacements);
/** Unlock unneeded layers in the layer cache.
- @param layerCache holder of the locked layers
+ @param context Owner of the layer cache (and thus the layers)
@param atlased Unneeded layers in the atlas
@param nonAtlased Unneeded layers in their own textures
@param recycled Unneeded layers that did not require rendering
*/
- static void UnlockLayers(GrLayerCache* layerCache,
- const SkTDArray<HoistedLayer>& atlased,
- const SkTDArray<HoistedLayer>& nonAtlased,
- const SkTDArray<HoistedLayer>& recycled);
+ static void UnlockLayers(GrContext* context,
+ const SkTDArray<GrHoistedLayer>& atlased,
+ const SkTDArray<GrHoistedLayer>& nonAtlased,
+ const SkTDArray<GrHoistedLayer>& recycled);
};
#endif
« no previous file with comments | « src/core/SkMultiPictureDraw.cpp ('k') | src/gpu/GrLayerHoister.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698