aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ccpr
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-06-14 14:31:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-15 11:33:14 +0000
commitc8cee446bf9c07da8848bbd032abf26e79966ac1 (patch)
tree5f024f9dfb1aca470915da9fae96eac0710f5884 /src/gpu/ccpr
parent9e6402677f1c8f2c3bdc3b812ee38ea2931d92b3 (diff)
Move op memory storage to GrContext
TBR=bsalomon@google.com Change-Id: Ifa95bf0073b9d948f2c937d10088b7734b971f90 Reviewed-on: https://skia-review.googlesource.com/131500 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/ccpr')
-rw-r--r--src/gpu/ccpr/GrCCDrawPathsOp.cpp16
-rw-r--r--src/gpu/ccpr/GrCCPerFlushResources.cpp5
2 files changed, 14 insertions, 7 deletions
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.cpp b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
index 16a2c663a5..35494b7a6d 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.cpp
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
@@ -23,16 +23,22 @@ static bool has_coord_transforms(const GrPaint& paint) {
return false;
}
-std::unique_ptr<GrCCDrawPathsOp> GrCCDrawPathsOp::Make(GrContext*, const SkIRect& clipIBounds,
- const SkMatrix& m, const SkPath& path,
- const SkRect& devBounds, GrPaint&& paint) {
+std::unique_ptr<GrCCDrawPathsOp> GrCCDrawPathsOp::Make(GrContext* context,
+ const SkIRect& clipIBounds,
+ const SkMatrix& m,
+ const SkPath& path,
+ const SkRect& devBounds,
+ GrPaint&& paint) {
SkIRect looseClippedIBounds;
devBounds.roundOut(&looseClippedIBounds); // GrCCPathParser might find slightly tighter bounds.
if (!looseClippedIBounds.intersect(clipIBounds)) {
return nullptr;
}
- return std::unique_ptr<GrCCDrawPathsOp>(
- new GrCCDrawPathsOp(looseClippedIBounds, m, path, devBounds, std::move(paint)));
+
+ GrOpMemoryPool* pool = context->contextPriv().opMemoryPool();
+
+ return pool->allocate<GrCCDrawPathsOp>(looseClippedIBounds, m, path,
+ devBounds, std::move(paint));
}
GrCCDrawPathsOp::GrCCDrawPathsOp(const SkIRect& looseClippedIBounds, const SkMatrix& m,
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.cpp b/src/gpu/ccpr/GrCCPerFlushResources.cpp
index 5b3dec0622..ef09df84a9 100644
--- a/src/gpu/ccpr/GrCCPerFlushResources.cpp
+++ b/src/gpu/ccpr/GrCCPerFlushResources.cpp
@@ -27,8 +27,9 @@ public:
static std::unique_ptr<GrDrawOp> Make(GrContext* context,
sk_sp<const GrCCPerFlushResources> resources,
CoverageCountBatchID batchID, const SkISize& drawBounds) {
- return std::unique_ptr<GrDrawOp>(new RenderAtlasOp(std::move(resources), batchID,
- drawBounds));
+ GrOpMemoryPool* pool = context->contextPriv().opMemoryPool();
+
+ return pool->allocate<RenderAtlasOp>(std::move(resources), batchID, drawBounds);
}
// GrDrawOp interface.