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

Side by Side Diff: src/gpu/GrTexture.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 | « src/gpu/GrSurface.cpp ('k') | src/gpu/GrTextureProvider.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 2011 Google Inc. 2 * Copyright 2011 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 "GrContext.h" 8 #include "GrContext.h"
9 #include "GrCaps.h" 9 #include "GrCaps.h"
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 textureSize = (size_t) fDesc.fWidth * fDesc.fHeight * GrBytesPerPixel(fD esc.fConfig); 44 textureSize = (size_t) fDesc.fWidth * fDesc.fHeight * GrBytesPerPixel(fD esc.fConfig);
45 } 45 }
46 46
47 if (this->texturePriv().hasMipMaps()) { 47 if (this->texturePriv().hasMipMaps()) {
48 // We don't have to worry about the mipmaps being a different size than 48 // We don't have to worry about the mipmaps being a different size than
49 // we'd expect because we never change fDesc.fWidth/fHeight. 49 // we'd expect because we never change fDesc.fWidth/fHeight.
50 textureSize += textureSize/3; 50 textureSize += textureSize/3;
51 } 51 }
52 52
53 SkASSERT(!SkToBool(fDesc.fFlags & kRenderTarget_GrSurfaceFlag)); 53 SkASSERT(!SkToBool(fDesc.fFlags & kRenderTarget_GrSurfaceFlag));
54 SkASSERT(textureSize <= WorseCaseSize(fDesc)); 54 SkASSERT(textureSize <= WorstCaseSize(fDesc));
55 55
56 return textureSize; 56 return textureSize;
57 } 57 }
58 58
59 void GrTexture::validateDesc() const { 59 void GrTexture::validateDesc() const {
60 if (this->asRenderTarget()) { 60 if (this->asRenderTarget()) {
61 // This texture has a render target 61 // This texture has a render target
62 SkASSERT(0 != (fDesc.fFlags & kRenderTarget_GrSurfaceFlag)); 62 SkASSERT(0 != (fDesc.fFlags & kRenderTarget_GrSurfaceFlag));
63 SkASSERT(fDesc.fSampleCnt == this->asRenderTarget()->numColorSamples()); 63 SkASSERT(fDesc.fSampleCnt == this->asRenderTarget()->numColorSamples());
64 } else { 64 } else {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 SkASSERT(desc.fSampleCnt < (1 << 8)); 119 SkASSERT(desc.fSampleCnt < (1 << 8));
120 SkASSERT(flags < (1 << 10)); 120 SkASSERT(flags < (1 << 10));
121 SkASSERT(static_cast<int>(origin) < (1 << 8)); 121 SkASSERT(static_cast<int>(origin) < (1 << 8));
122 122
123 GrScratchKey::Builder builder(key, kType, 3); 123 GrScratchKey::Builder builder(key, kType, 3);
124 builder[0] = desc.fWidth; 124 builder[0] = desc.fWidth;
125 builder[1] = desc.fHeight; 125 builder[1] = desc.fHeight;
126 builder[2] = desc.fConfig | (desc.fIsMipMapped << 5) | (desc.fSampleCnt << 6 ) | (flags << 14) 126 builder[2] = desc.fConfig | (desc.fIsMipMapped << 5) | (desc.fSampleCnt << 6 ) | (flags << 14)
127 | (origin << 24); 127 | (origin << 24);
128 } 128 }
OLDNEW
« no previous file with comments | « src/gpu/GrSurface.cpp ('k') | src/gpu/GrTextureProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698