aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrSmallPathRenderer.h
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-09-26 12:45:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-26 17:06:16 +0000
commit106b5c4917636d3df70ee6f59661ac5fa506d087 (patch)
treef23abd882319273d0d7868831f0158867a7bac65 /src/gpu/ops/GrSmallPathRenderer.h
parent8d1776970097502f9cff5fb9504a656c8be3193c (diff)
Shrink GrDrawOpAtlases when no longer needed, take 2.
Bug: skia:3550 Change-Id: Id483a76b9edcf29f7ea0aad0dd8946a3655ba8f2 Reviewed-on: https://skia-review.googlesource.com/50600 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/ops/GrSmallPathRenderer.h')
-rw-r--r--src/gpu/ops/GrSmallPathRenderer.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gpu/ops/GrSmallPathRenderer.h b/src/gpu/ops/GrSmallPathRenderer.h
index b958baa843..99bb88ff15 100644
--- a/src/gpu/ops/GrSmallPathRenderer.h
+++ b/src/gpu/ops/GrSmallPathRenderer.h
@@ -9,6 +9,7 @@
#define GrSmallPathRenderer_DEFINED
#include "GrDrawOpAtlas.h"
+#include "GrOnFlushResourceProvider.h"
#include "GrPathRenderer.h"
#include "GrRect.h"
#include "GrShape.h"
@@ -18,7 +19,7 @@
class GrContext;
-class GrSmallPathRenderer : public GrPathRenderer {
+class GrSmallPathRenderer : public GrPathRenderer, public GrOnFlushCallbackObject {
public:
GrSmallPathRenderer();
~GrSmallPathRenderer() override;
@@ -26,6 +27,21 @@ public:
class SmallPathOp;
struct PathTestStruct;
+ // GrOnFlushCallbackObject overrides
+ //
+ // Note: because this class is associated with a path renderer we want it to be removed from
+ // the list of active OnFlushBackkbackObjects in an freeGpuResources call (i.e., we accept the
+ // default retainOnFreeGpuResources implementation).
+
+ void preFlush(GrOnFlushResourceProvider*, const uint32_t*, int,
+ SkTArray<sk_sp<GrRenderTargetContext>>*) override {}
+
+ void postFlush(GrDrawOpUploadToken startTokenForNextFlush) override {
+ if (fAtlas) {
+ fAtlas->compact(startTokenForNextFlush);
+ }
+ }
+
private:
StencilSupport onGetStencilSupport(const GrShape&) const override {
return GrPathRenderer::kNoSupport_StencilSupport;