| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 190 GrVertexBuffer* GrGpu::createVertexBuffer(uint32_t size, bool dynamic) { | 190 GrVertexBuffer* GrGpu::createVertexBuffer(uint32_t size, bool dynamic) { | 
| 191     this->handleDirtyContext(); | 191     this->handleDirtyContext(); | 
| 192     return this->onCreateVertexBuffer(size, dynamic); | 192     return this->onCreateVertexBuffer(size, dynamic); | 
| 193 } | 193 } | 
| 194 | 194 | 
| 195 GrIndexBuffer* GrGpu::createIndexBuffer(uint32_t size, bool dynamic) { | 195 GrIndexBuffer* GrGpu::createIndexBuffer(uint32_t size, bool dynamic) { | 
| 196     this->handleDirtyContext(); | 196     this->handleDirtyContext(); | 
| 197     return this->onCreateIndexBuffer(size, dynamic); | 197     return this->onCreateIndexBuffer(size, dynamic); | 
| 198 } | 198 } | 
| 199 | 199 | 
| 200 GrPath* GrGpu::createPath(const SkPath& path) { | 200 GrPath* GrGpu::createPath(const SkPath& path, const SkStrokeRec& stroke) { | 
| 201     SkASSERT(this->caps()->pathRenderingSupport()); | 201     SkASSERT(this->caps()->pathRenderingSupport()); | 
| 202     this->handleDirtyContext(); | 202     this->handleDirtyContext(); | 
| 203     return this->onCreatePath(path); | 203     return this->onCreatePath(path, stroke); | 
| 204 } | 204 } | 
| 205 | 205 | 
| 206 void GrGpu::clear(const SkIRect* rect, | 206 void GrGpu::clear(const SkIRect* rect, | 
| 207                   GrColor color, | 207                   GrColor color, | 
| 208                   GrRenderTarget* renderTarget) { | 208                   GrRenderTarget* renderTarget) { | 
| 209     GrDrawState::AutoRenderTargetRestore art; | 209     GrDrawState::AutoRenderTargetRestore art; | 
| 210     if (NULL != renderTarget) { | 210     if (NULL != renderTarget) { | 
| 211         art.set(this->drawState(), renderTarget); | 211         art.set(this->drawState(), renderTarget); | 
| 212     } | 212     } | 
| 213     if (NULL == this->getDrawState().getRenderTarget()) { | 213     if (NULL == this->getDrawState().getRenderTarget()) { | 
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 375     this->handleDirtyContext(); | 375     this->handleDirtyContext(); | 
| 376     GrDrawState::AutoRestoreEffects are; | 376     GrDrawState::AutoRestoreEffects are; | 
| 377     if (!this->setupClipAndFlushState(PrimTypeToDrawType(info.primitiveType()), | 377     if (!this->setupClipAndFlushState(PrimTypeToDrawType(info.primitiveType()), | 
| 378                                       info.getDstCopy(), | 378                                       info.getDstCopy(), | 
| 379                                       &are)) { | 379                                       &are)) { | 
| 380         return; | 380         return; | 
| 381     } | 381     } | 
| 382     this->onGpuDraw(info); | 382     this->onGpuDraw(info); | 
| 383 } | 383 } | 
| 384 | 384 | 
| 385 void GrGpu::onStencilPath(const GrPath* path, const SkStrokeRec&, SkPath::FillTy
     pe fill) { | 385 void GrGpu::onStencilPath(const GrPath* path, SkPath::FillType fill) { | 
| 386     this->handleDirtyContext(); | 386     this->handleDirtyContext(); | 
| 387 | 387 | 
| 388     GrDrawState::AutoRestoreEffects are; | 388     GrDrawState::AutoRestoreEffects are; | 
| 389     if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) { | 389     if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) { | 
| 390         return; | 390         return; | 
| 391     } | 391     } | 
| 392 | 392 | 
| 393     this->onGpuStencilPath(path, fill); | 393     this->onGpuStencilPath(path, fill); | 
| 394 } | 394 } | 
| 395 | 395 | 
| 396 void GrGpu::onFillPath(const GrPath* path, const SkStrokeRec& stroke, SkPath::Fi
     llType fill, | 396 | 
|  | 397 void GrGpu::onDrawPath(const GrPath* path, SkPath::FillType fill, | 
| 397                        const GrDeviceCoordTexture* dstCopy) { | 398                        const GrDeviceCoordTexture* dstCopy) { | 
| 398     this->handleDirtyContext(); | 399     this->handleDirtyContext(); | 
| 399 | 400 | 
| 400     drawState()->setDefaultVertexAttribs(); | 401     drawState()->setDefaultVertexAttribs(); | 
| 401 | 402 | 
| 402     GrDrawState::AutoRestoreEffects are; | 403     GrDrawState::AutoRestoreEffects are; | 
| 403     if (!this->setupClipAndFlushState(kFillPath_DrawType, dstCopy, &are)) { | 404     if (!this->setupClipAndFlushState(kDrawPath_DrawType, dstCopy, &are)) { | 
| 404         return; | 405         return; | 
| 405     } | 406     } | 
| 406 | 407 | 
| 407     this->onGpuFillPath(path, fill); | 408     this->onGpuDrawPath(path, fill); | 
| 408 } | 409 } | 
| 409 | 410 | 
| 410 void GrGpu::finalizeReservedVertices() { | 411 void GrGpu::finalizeReservedVertices() { | 
| 411     SkASSERT(NULL != fVertexPool); | 412     SkASSERT(NULL != fVertexPool); | 
| 412     fVertexPool->unlock(); | 413     fVertexPool->unlock(); | 
| 413 } | 414 } | 
| 414 | 415 | 
| 415 void GrGpu::finalizeReservedIndices() { | 416 void GrGpu::finalizeReservedIndices() { | 
| 416     SkASSERT(NULL != fIndexPool); | 417     SkASSERT(NULL != fIndexPool); | 
| 417     fIndexPool->unlock(); | 418     fIndexPool->unlock(); | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 537 } | 538 } | 
| 538 | 539 | 
| 539 void GrGpu::releaseIndexArray() { | 540 void GrGpu::releaseIndexArray() { | 
| 540     // if index source was array, we stowed data in the pool | 541     // if index source was array, we stowed data in the pool | 
| 541     const GeometrySrcState& geoSrc = this->getGeomSrc(); | 542     const GeometrySrcState& geoSrc = this->getGeomSrc(); | 
| 542     SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); | 543     SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); | 
| 543     size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); | 544     size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); | 
| 544     fIndexPool->putBack(bytes); | 545     fIndexPool->putBack(bytes); | 
| 545     --fIndexPoolUseCnt; | 546     --fIndexPoolUseCnt; | 
| 546 } | 547 } | 
| OLD | NEW | 
|---|