OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 GrGpu::~GrGpu() { | 52 GrGpu::~GrGpu() { |
53 SkSafeSetNull(fQuadIndexBuffer); | 53 SkSafeSetNull(fQuadIndexBuffer); |
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::contextAbandonded() {} | 60 void GrGpu::contextAbandoned() {} |
61 | 61 |
62 //////////////////////////////////////////////////////////////////////////////// | 62 //////////////////////////////////////////////////////////////////////////////// |
63 | 63 |
64 GrTexture* GrGpu::createTexture(const GrTextureDesc& desc, | 64 GrTexture* GrGpu::createTexture(const GrTextureDesc& 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_GrTextureFlagBit) && |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 } | 522 } |
523 | 523 |
524 void GrGpu::releaseIndexArray() { | 524 void GrGpu::releaseIndexArray() { |
525 // if index source was array, we stowed data in the pool | 525 // if index source was array, we stowed data in the pool |
526 const GeometrySrcState& geoSrc = this->getGeomSrc(); | 526 const GeometrySrcState& geoSrc = this->getGeomSrc(); |
527 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); | 527 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); |
528 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); | 528 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); |
529 fIndexPool->putBack(bytes); | 529 fIndexPool->putBack(bytes); |
530 --fIndexPoolUseCnt; | 530 --fIndexPoolUseCnt; |
531 } | 531 } |
OLD | NEW |