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

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

Issue 682223002: rename GrTextureDesc->GrSurfaceDesc, GrTextureFlags->GrSurfaceFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: const Created 6 years, 1 month 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/GrGpu.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 delete fVertexPool; 54 delete fVertexPool;
55 fVertexPool = NULL; 55 fVertexPool = NULL;
56 delete fIndexPool; 56 delete fIndexPool;
57 fIndexPool = NULL; 57 fIndexPool = NULL;
58 } 58 }
59 59
60 void GrGpu::contextAbandoned() {} 60 void GrGpu::contextAbandoned() {}
61 61
62 //////////////////////////////////////////////////////////////////////////////// 62 ////////////////////////////////////////////////////////////////////////////////
63 63
64 GrTexture* GrGpu::createTexture(const GrTextureDesc& desc, 64 GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc,
65 const void* srcData, size_t rowBytes) { 65 const void* srcData, size_t rowBytes) {
66 if (!this->caps()->isConfigTexturable(desc.fConfig)) { 66 if (!this->caps()->isConfigTexturable(desc.fConfig)) {
67 return NULL; 67 return NULL;
68 } 68 }
69 69
70 if ((desc.fFlags & kRenderTarget_GrTextureFlagBit) && 70 if ((desc.fFlags & kRenderTarget_GrSurfaceFlag) &&
71 !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { 71 !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
72 return NULL; 72 return NULL;
73 } 73 }
74 74
75 GrTexture *tex = NULL; 75 GrTexture *tex = NULL;
76 if (GrPixelConfigIsCompressed(desc.fConfig)) { 76 if (GrPixelConfigIsCompressed(desc.fConfig)) {
77 // We shouldn't be rendering into this 77 // We shouldn't be rendering into this
78 SkASSERT((desc.fFlags & kRenderTarget_GrTextureFlagBit) == 0); 78 SkASSERT((desc.fFlags & kRenderTarget_GrSurfaceFlag) == 0);
79 79
80 if (!this->caps()->npotTextureTileSupport() && 80 if (!this->caps()->npotTextureTileSupport() &&
81 (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight))) { 81 (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight))) {
82 return NULL; 82 return NULL;
83 } 83 }
84 84
85 this->handleDirtyContext(); 85 this->handleDirtyContext();
86 tex = this->onCreateCompressedTexture(desc, srcData); 86 tex = this->onCreateCompressedTexture(desc, srcData);
87 } else { 87 } else {
88 this->handleDirtyContext(); 88 this->handleDirtyContext();
89 tex = this->onCreateTexture(desc, srcData, rowBytes); 89 tex = this->onCreateTexture(desc, srcData, rowBytes);
90 if (tex && 90 if (tex &&
91 (kRenderTarget_GrTextureFlagBit & desc.fFlags) && 91 (kRenderTarget_GrSurfaceFlag & desc.fFlags) &&
92 !(kNoStencil_GrTextureFlagBit & desc.fFlags)) { 92 !(kNoStencil_GrSurfaceFlag & desc.fFlags)) {
93 SkASSERT(tex->asRenderTarget()); 93 SkASSERT(tex->asRenderTarget());
94 // TODO: defer this and attach dynamically 94 // TODO: defer this and attach dynamically
95 if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget())) { 95 if (!this->attachStencilBufferToRenderTarget(tex->asRenderTarget())) {
96 tex->unref(); 96 tex->unref();
97 return NULL; 97 return NULL;
98 } 98 }
99 } 99 }
100 } 100 }
101 return tex; 101 return tex;
102 } 102 }
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 } 533 }
534 534
535 void GrGpu::releaseIndexArray() { 535 void GrGpu::releaseIndexArray() {
536 // if index source was array, we stowed data in the pool 536 // if index source was array, we stowed data in the pool
537 const GeometrySrcState& geoSrc = this->getGeomSrc(); 537 const GeometrySrcState& geoSrc = this->getGeomSrc();
538 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); 538 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc);
539 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); 539 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t);
540 fIndexPool->putBack(bytes); 540 fIndexPool->putBack(bytes);
541 --fIndexPoolUseCnt; 541 --fIndexPoolUseCnt;
542 } 542 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698