diff options
author | 2018-02-01 14:16:02 -0500 | |
---|---|---|
committer | 2018-02-01 21:15:39 +0000 | |
commit | d0d7270fcc32546005b8e847df516cb11592cd30 (patch) | |
tree | 032f102536ecb8e665c348b733b230a062a1c010 /src/gpu/GrRenderTargetProxy.cpp | |
parent | 2331c82e0d10ee519d9afb3f9e85485c6cf0b3c3 (diff) |
Revert "Revert "Redefine the meaning of sample counts in GPU backend.""
Fixes gpu config default samples to be 1 and updates config parsing test accordingly.
This reverts commit c1ce2f7966babaae0deb150f93f1227ee5af9285.
Bug: skia:
Change-Id: I456973b1f52ced85a2011ea10fc49449bfc5846f
Reviewed-on: https://skia-review.googlesource.com/102147
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetProxy.cpp')
-rw-r--r-- | src/gpu/GrRenderTargetProxy.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp index 9eb37a0b2f..841d4b18fd 100644 --- a/src/gpu/GrRenderTargetProxy.cpp +++ b/src/gpu/GrRenderTargetProxy.cpp @@ -26,7 +26,7 @@ GrRenderTargetProxy::GrRenderTargetProxy(const GrCaps& caps, const GrSurfaceDesc , fRenderTargetFlags(GrRenderTargetFlags::kNone) { // Since we know the newly created render target will be internal, we are able to precompute // what the flags will ultimately end up being. - if (caps.usesMixedSamples() && fSampleCnt > 0) { + if (caps.usesMixedSamples() && fSampleCnt > 1) { fRenderTargetFlags |= GrRenderTargetFlags::kMixedSampled; } if (caps.maxWindowRectangles() > 0) { @@ -97,7 +97,11 @@ sk_sp<GrSurface> GrRenderTargetProxy::createSurface(GrResourceProvider* resource } size_t GrRenderTargetProxy::onUninstantiatedGpuMemorySize() const { - int colorSamplesPerPixel = this->numColorSamples() + 1; + int colorSamplesPerPixel = this->numColorSamples(); + if (colorSamplesPerPixel > 1) { + // Add one for the resolve buffer. + ++colorSamplesPerPixel; + } // TODO: do we have enough information to improve this worst case estimate? return GrSurface::ComputeSize(this->config(), this->width(), this->height(), |