aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetProxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrRenderTargetProxy.cpp')
-rw-r--r--src/gpu/GrRenderTargetProxy.cpp8
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(),