Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: src/gpu/GrSurface.cpp

Issue 2259863002: Rename WorseCaseSize to WorstCasSize (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrSurface.h ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrSurface.h" 8 #include "GrSurface.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrSurfacePriv.h" 10 #include "GrSurfacePriv.h"
11 11
12 #include "SkBitmap.h" 12 #include "SkBitmap.h"
13 #include "SkGrPriv.h" 13 #include "SkGrPriv.h"
14 #include "SkImageEncoder.h" 14 #include "SkImageEncoder.h"
15 #include <stdio.h> 15 #include <stdio.h>
16 16
17 size_t GrSurface::WorseCaseSize(const GrSurfaceDesc& desc) { 17 size_t GrSurface::WorstCaseSize(const GrSurfaceDesc& desc) {
18 size_t size; 18 size_t size;
19 19
20 bool isRenderTarget = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag); 20 bool isRenderTarget = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag);
21 if (isRenderTarget) { 21 if (isRenderTarget) {
22 // We own one color value for each MSAA sample. 22 // We own one color value for each MSAA sample.
23 int colorValuesPerPixel = SkTMax(1, desc.fSampleCnt); 23 int colorValuesPerPixel = SkTMax(1, desc.fSampleCnt);
24 if (desc.fSampleCnt) { 24 if (desc.fSampleCnt) {
25 // Worse case, we own the resolve buffer so that is one more sample per pixel. 25 // Worse case, we own the resolve buffer so that is one more sample per pixel.
26 colorValuesPerPixel += 1; 26 colorValuesPerPixel += 1;
27 } 27 }
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 void GrSurface::onRelease() { 189 void GrSurface::onRelease() {
190 this->invokeReleaseProc(); 190 this->invokeReleaseProc();
191 this->INHERITED::onRelease(); 191 this->INHERITED::onRelease();
192 } 192 }
193 193
194 void GrSurface::onAbandon() { 194 void GrSurface::onAbandon() {
195 this->invokeReleaseProc(); 195 this->invokeReleaseProc();
196 this->INHERITED::onAbandon(); 196 this->INHERITED::onAbandon();
197 } 197 }
OLDNEW
« no previous file with comments | « include/gpu/GrSurface.h ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698