aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkSpecialSurface.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-10-27 14:47:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-27 19:14:09 +0000
commit1105224f9701e57ec5ce0354d6a380b664f5c638 (patch)
tree2b6f3db0bfd99da5e22adabc0da37d9271c8b543 /src/core/SkSpecialSurface.cpp
parent6e74412a9cf1ffa44271a55b42f18e8a0813a0a2 (diff)
Rename GrDrawContext to GrRenderTargetContext
This is in preparation for GrTextureContext and GrSurfaceContext BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4030 Change-Id: Ie58c93052e68f3f1f5fe8d15d63760de274a6fbd Reviewed-on: https://skia-review.googlesource.com/4030 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core/SkSpecialSurface.cpp')
-rw-r--r--src/core/SkSpecialSurface.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp
index 85bb61a3e3..b719be2969 100644
--- a/src/core/SkSpecialSurface.cpp
+++ b/src/core/SkSpecialSurface.cpp
@@ -115,13 +115,13 @@ sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRaster(const SkImageInfo& info,
class SkSpecialSurface_Gpu : public SkSpecialSurface_Base {
public:
- SkSpecialSurface_Gpu(sk_sp<GrDrawContext> drawContext,
+ SkSpecialSurface_Gpu(sk_sp<GrRenderTargetContext> renderTargetContext,
int width, int height,
const SkIRect& subset)
- : INHERITED(subset, &drawContext->surfaceProps())
- , fDrawContext(std::move(drawContext)) {
+ : INHERITED(subset, &renderTargetContext->surfaceProps())
+ , fRenderTargetContext(std::move(renderTargetContext)) {
- sk_sp<SkBaseDevice> device(SkGpuDevice::Make(fDrawContext, width, height,
+ sk_sp<SkBaseDevice> device(SkGpuDevice::Make(fRenderTargetContext, width, height,
SkGpuDevice::kUninit_InitContents));
if (!device) {
return;
@@ -138,17 +138,17 @@ public:
sk_sp<SkSpecialImage> onMakeImageSnapshot() override {
sk_sp<SkSpecialImage> tmp(SkSpecialImage::MakeFromGpu(
- this->subset(),
- kNeedNewImageUniqueID_SpecialImage,
- fDrawContext->asTexture(),
- sk_ref_sp(fDrawContext->getColorSpace()),
- &this->props()));
- fDrawContext = nullptr;
+ this->subset(),
+ kNeedNewImageUniqueID_SpecialImage,
+ fRenderTargetContext->asTexture(),
+ sk_ref_sp(fRenderTargetContext->getColorSpace()),
+ &this->props()));
+ fRenderTargetContext = nullptr;
return tmp;
}
private:
- sk_sp<GrDrawContext> fDrawContext;
+ sk_sp<GrRenderTargetContext> fRenderTargetContext;
typedef SkSpecialSurface_Base INHERITED;
};
@@ -161,16 +161,15 @@ sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRenderTarget(GrContext* context,
return nullptr;
}
- sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApprox,
- width, height, config,
- std::move(colorSpace)));
- if (!drawContext) {
+ sk_sp<GrRenderTargetContext> renderTargetContext(context->makeRenderTargetContext(
+ SkBackingFit::kApprox, width, height, config, std::move(colorSpace)));
+ if (!renderTargetContext) {
return nullptr;
}
const SkIRect subset = SkIRect::MakeWH(width, height);
- return sk_make_sp<SkSpecialSurface_Gpu>(std::move(drawContext), width, height, subset);
+ return sk_make_sp<SkSpecialSurface_Gpu>(std::move(renderTargetContext), width, height, subset);
}
#endif