| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  211     this->handleDirtyContext(); |  211     this->handleDirtyContext(); | 
|  212     return this->onCreateIndexBuffer(size, dynamic); |  212     return this->onCreateIndexBuffer(size, dynamic); | 
|  213 } |  213 } | 
|  214  |  214  | 
|  215 GrPath* GrGpu::createPath(const SkPath& path, const SkStrokeRec& stroke) { |  215 GrPath* GrGpu::createPath(const SkPath& path, const SkStrokeRec& stroke) { | 
|  216     SkASSERT(this->caps()->pathRenderingSupport()); |  216     SkASSERT(this->caps()->pathRenderingSupport()); | 
|  217     this->handleDirtyContext(); |  217     this->handleDirtyContext(); | 
|  218     return this->onCreatePath(path, stroke); |  218     return this->onCreatePath(path, stroke); | 
|  219 } |  219 } | 
|  220  |  220  | 
 |  221 GrPathRange* GrGpu::createPathRange(size_t size, const SkStrokeRec& stroke) { | 
 |  222     SkASSERT(this->caps()->pathRenderingSupport()); | 
 |  223     this->handleDirtyContext(); | 
 |  224     return this->onCreatePathRange(size, stroke); | 
 |  225 } | 
 |  226  | 
|  221 void GrGpu::clear(const SkIRect* rect, |  227 void GrGpu::clear(const SkIRect* rect, | 
|  222                   GrColor color, |  228                   GrColor color, | 
|  223                   bool canIgnoreRect, |  229                   bool canIgnoreRect, | 
|  224                   GrRenderTarget* renderTarget) { |  230                   GrRenderTarget* renderTarget) { | 
|  225     GrDrawState::AutoRenderTargetRestore art; |  231     GrDrawState::AutoRenderTargetRestore art; | 
|  226     if (NULL != renderTarget) { |  232     if (NULL != renderTarget) { | 
|  227         art.set(this->drawState(), renderTarget); |  233         art.set(this->drawState(), renderTarget); | 
|  228     } |  234     } | 
|  229     if (NULL == this->getDrawState().getRenderTarget()) { |  235     if (NULL == this->getDrawState().getRenderTarget()) { | 
|  230         SkASSERT(0); |  236         SkASSERT(0); | 
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  412     drawState()->setDefaultVertexAttribs(); |  418     drawState()->setDefaultVertexAttribs(); | 
|  413  |  419  | 
|  414     GrDrawState::AutoRestoreEffects are; |  420     GrDrawState::AutoRestoreEffects are; | 
|  415     if (!this->setupClipAndFlushState(kDrawPath_DrawType, dstCopy, &are, NULL)) 
     { |  421     if (!this->setupClipAndFlushState(kDrawPath_DrawType, dstCopy, &are, NULL)) 
     { | 
|  416         return; |  422         return; | 
|  417     } |  423     } | 
|  418  |  424  | 
|  419     this->onGpuDrawPath(path, fill); |  425     this->onGpuDrawPath(path, fill); | 
|  420 } |  426 } | 
|  421  |  427  | 
|  422 void GrGpu::onDrawPaths(int pathCount, const GrPath** paths, |  428 void GrGpu::onDrawPaths(const GrPathRange* pathRange, | 
|  423                         const SkMatrix* transforms, SkPath::FillType fill, |  429                         const uint32_t indices[], int count, | 
|  424                         SkStrokeRec::Style style, |  430                         const float transforms[], PathTransformType transformsTy
     pe, | 
|  425                         const GrDeviceCoordTexture* dstCopy) { |  431                         SkPath::FillType fill, const GrDeviceCoordTexture* dstCo
     py) { | 
|  426     this->handleDirtyContext(); |  432     this->handleDirtyContext(); | 
|  427  |  433  | 
|  428     drawState()->setDefaultVertexAttribs(); |  434     drawState()->setDefaultVertexAttribs(); | 
|  429  |  435  | 
|  430     GrDrawState::AutoRestoreEffects are; |  436     GrDrawState::AutoRestoreEffects are; | 
|  431     if (!this->setupClipAndFlushState(kDrawPaths_DrawType, dstCopy, &are, NULL))
      { |  437     if (!this->setupClipAndFlushState(kDrawPaths_DrawType, dstCopy, &are, NULL))
      { | 
|  432         return; |  438         return; | 
|  433     } |  439     } | 
|  434  |  440  | 
|  435     this->onGpuDrawPaths(pathCount, paths, transforms, fill, style); |  441     this->onGpuDrawPaths(pathRange, indices, count, transforms, transformsType, 
     fill); | 
|  436 } |  442 } | 
|  437  |  443  | 
|  438 void GrGpu::finalizeReservedVertices() { |  444 void GrGpu::finalizeReservedVertices() { | 
|  439     SkASSERT(NULL != fVertexPool); |  445     SkASSERT(NULL != fVertexPool); | 
|  440     fVertexPool->unmap(); |  446     fVertexPool->unmap(); | 
|  441 } |  447 } | 
|  442  |  448  | 
|  443 void GrGpu::finalizeReservedIndices() { |  449 void GrGpu::finalizeReservedIndices() { | 
|  444     SkASSERT(NULL != fIndexPool); |  450     SkASSERT(NULL != fIndexPool); | 
|  445     fIndexPool->unmap(); |  451     fIndexPool->unmap(); | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  565 } |  571 } | 
|  566  |  572  | 
|  567 void GrGpu::releaseIndexArray() { |  573 void GrGpu::releaseIndexArray() { | 
|  568     // if index source was array, we stowed data in the pool |  574     // if index source was array, we stowed data in the pool | 
|  569     const GeometrySrcState& geoSrc = this->getGeomSrc(); |  575     const GeometrySrcState& geoSrc = this->getGeomSrc(); | 
|  570     SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); |  576     SkASSERT(kArray_GeometrySrcType == geoSrc.fIndexSrc); | 
|  571     size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); |  577     size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); | 
|  572     fIndexPool->putBack(bytes); |  578     fIndexPool->putBack(bytes); | 
|  573     --fIndexPoolUseCnt; |  579     --fIndexPoolUseCnt; | 
|  574 } |  580 } | 
| OLD | NEW |