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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) { | 157 GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) { |
158 this->handleDirtyContext(); | 158 this->handleDirtyContext(); |
159 return this->onCreateVertexBuffer(size, dynamic); | 159 return this->onCreateVertexBuffer(size, dynamic); |
160 } | 160 } |
161 | 161 |
162 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { | 162 GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { |
163 this->handleDirtyContext(); | 163 this->handleDirtyContext(); |
164 return this->onCreateIndexBuffer(size, dynamic); | 164 return this->onCreateIndexBuffer(size, dynamic); |
165 } | 165 } |
166 | 166 |
167 GrPath* GrGpu::createPath(const SkPath& path, const SkStrokeRec& stroke) { | |
168 SkASSERT(this->caps()->pathRenderingSupport()); | |
169 this->handleDirtyContext(); | |
170 return this->pathRendering()->createPath(path, stroke); | |
171 } | |
172 | |
173 GrPathRange* GrGpu::createPathRange(size_t size, const SkStrokeRec& stroke) { | |
174 this->handleDirtyContext(); | |
175 return this->pathRendering()->createPathRange(size, stroke); | |
176 } | |
177 | |
178 void GrGpu::clear(const SkIRect* rect, | 167 void GrGpu::clear(const SkIRect* rect, |
179 GrColor color, | 168 GrColor color, |
180 bool canIgnoreRect, | 169 bool canIgnoreRect, |
181 GrRenderTarget* renderTarget) { | 170 GrRenderTarget* renderTarget) { |
182 if (NULL == renderTarget) { | 171 if (NULL == renderTarget) { |
183 renderTarget = this->getDrawState().getRenderTarget(); | 172 renderTarget = this->getDrawState().getRenderTarget(); |
184 } | 173 } |
185 if (NULL == renderTarget) { | 174 if (NULL == renderTarget) { |
186 SkASSERT(0); | 175 SkASSERT(0); |
187 return; | 176 return; |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 } | 511 } |
523 | 512 |
524 void GrGpu::releaseIndexArray() { | 513 void GrGpu::releaseIndexArray() { |
525 // if index source was array, we stowed data in the pool | 514 // if index source was array, we stowed data in the pool |
526 const GeometrySrcState& geoSrc = this->getGeomSrc(); | 515 const GeometrySrcState& geoSrc = this->getGeomSrc(); |
527 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); | 516 SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); |
528 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); | 517 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); |
529 fIndexPool->putBack(bytes); | 518 fIndexPool->putBack(bytes); |
530 --fIndexPoolUseCnt; | 519 --fIndexPoolUseCnt; |
531 } | 520 } |
OLD | NEW |