aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-15 16:28:07 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-16 21:15:20 +0000
commit50e66d4ab43685acce5a7a942074d562c5fd9639 (patch)
tree568536c3a9d5ee2554004440e57d4867bccfc556 /src
parenta63e7ab3bbb2140456378cce0eff23eb74b3583a (diff)
Remove GrRenderTargetContext::desc()
Change-Id: I04bf4a5b443f799896f62fe7aa61b6fb5d5c9c7f Reviewed-on: https://skia-review.googlesource.com/16918 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrRenderTargetContext.h2
-rw-r--r--src/gpu/SkGpuDevice.cpp4
-rw-r--r--src/image/SkSurface_Gpu.cpp7
3 files changed, 8 insertions, 5 deletions
diff --git a/src/gpu/GrRenderTargetContext.h b/src/gpu/GrRenderTargetContext.h
index 40d8732bef..a749046d24 100644
--- a/src/gpu/GrRenderTargetContext.h
+++ b/src/gpu/GrRenderTargetContext.h
@@ -347,11 +347,11 @@ public:
GrFSAAType fsaaType() const { return fRenderTargetProxy->fsaaType(); }
const GrCaps* caps() const { return fContext->caps(); }
- const GrSurfaceDesc& desc() const { return fRenderTargetProxy->desc(); }
int width() const { return fRenderTargetProxy->width(); }
int height() const { return fRenderTargetProxy->height(); }
GrPixelConfig config() const { return fRenderTargetProxy->config(); }
int numColorSamples() const { return fRenderTargetProxy->numColorSamples(); }
+ int numStencilSamples() const { return fRenderTargetProxy->numStencilSamples(); }
const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; }
GrColorSpaceXform* getColorXformFromSRGB() const { return fColorXformFromSRGB.get(); }
GrSurfaceOrigin origin() const { return fRenderTargetProxy->origin(); }
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 5640ef60a3..c90ad28129 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1762,7 +1762,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
cinfo.fInfo.width(), cinfo.fInfo.height(),
fRenderTargetContext->config(),
fRenderTargetContext->refColorSpace(),
- fRenderTargetContext->desc().fSampleCnt,
+ fRenderTargetContext->numStencilSamples(),
kBottomLeft_GrSurfaceOrigin,
&props));
if (!rtc) {
@@ -1781,7 +1781,7 @@ sk_sp<SkSurface> SkGpuDevice::makeSurface(const SkImageInfo& info, const SkSurfa
// TODO: Change the signature of newSurface to take a budgeted parameter.
static const SkBudgeted kBudgeted = SkBudgeted::kNo;
return SkSurface::MakeRenderTarget(fContext.get(), kBudgeted, info,
- fRenderTargetContext->desc().fSampleCnt,
+ fRenderTargetContext->numStencilSamples(),
fRenderTargetContext->origin(), &props);
}
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 5001811cea..992e4c9274 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -106,8 +106,11 @@ sk_sp<SkImage> SkSurface_Gpu::onNewImageSnapshot() {
// copy-on-write.
if (!srcProxy || rtc->priv().refsWrappedObjects()) {
// MDB TODO: replace this with GrSurfaceProxy::Copy?
- GrSurfaceDesc desc = rtc->desc();
- desc.fFlags = desc.fFlags & ~kRenderTarget_GrSurfaceFlag;
+ GrSurfaceDesc desc;
+ desc.fConfig = rtc->config();
+ desc.fWidth = rtc->width();
+ desc.fHeight = rtc->height();
+ desc.fOrigin = rtc->origin();
sk_sp<GrSurfaceContext> copyCtx = ctx->contextPriv().makeDeferredSurfaceContext(
desc,