aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrSurface.cpp')
-rw-r--r--src/gpu/GrSurface.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index b35683c548..ec503d7066 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -29,9 +29,8 @@ size_t GrSurface::WorstCaseSize(const GrSurfaceDesc& desc, bool useNextPow2) {
bool isRenderTarget = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag);
if (isRenderTarget) {
// We own one color value for each MSAA sample.
- SkASSERT(desc.fSampleCnt >= 1);
- int colorValuesPerPixel = desc.fSampleCnt;
- if (desc.fSampleCnt > 1) {
+ int colorValuesPerPixel = SkTMax(1, desc.fSampleCnt);
+ if (desc.fSampleCnt) {
// Worse case, we own the resolve buffer so that is one more sample per pixel.
colorValuesPerPixel += 1;
}