| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 6, | 268 6, |
| 269 MAX_QUADS, | 269 MAX_QUADS, |
| 270 4); | 270 4); |
| 271 } | 271 } |
| 272 | 272 |
| 273 return fQuadIndexBuffer; | 273 return fQuadIndexBuffer; |
| 274 } | 274 } |
| 275 | 275 |
| 276 //////////////////////////////////////////////////////////////////////////////// | 276 //////////////////////////////////////////////////////////////////////////////// |
| 277 | 277 |
| 278 void GrGpu::draw(const GrOptDrawState& ds, const GrDrawTarget::DrawInfo& info) { | 278 void GrGpu::draw(const GrOptDrawState& ds, |
| 279 const GrProgramDesc& desc, |
| 280 const GrDrawTarget::DrawInfo& info) { |
| 279 this->handleDirtyContext(); | 281 this->handleDirtyContext(); |
| 280 if (!this->flushGraphicsState(ds, PrimTypeToDrawType(info.primitiveType())))
{ | 282 if (!this->flushGraphicsState(ds, desc, PrimTypeToDrawType(info.primitiveTyp
e()))) { |
| 281 return; | 283 return; |
| 282 } | 284 } |
| 283 this->onDraw(ds, info); | 285 this->onDraw(ds, info); |
| 284 } | 286 } |
| 285 | 287 |
| 286 void GrGpu::stencilPath(const GrOptDrawState& ds, | 288 void GrGpu::stencilPath(const GrOptDrawState& ds, |
| 289 const GrProgramDesc& desc, |
| 287 const GrPath* path, | 290 const GrPath* path, |
| 288 const GrStencilSettings& stencilSettings) { | 291 const GrStencilSettings& stencilSettings) { |
| 289 this->handleDirtyContext(); | 292 this->handleDirtyContext(); |
| 290 | 293 |
| 291 if (!this->flushGraphicsState(ds, kStencilPath_DrawType)) { | 294 if (!this->flushGraphicsState(ds, desc, kStencilPath_DrawType)) { |
| 292 return; | 295 return; |
| 293 } | 296 } |
| 294 | 297 |
| 295 this->pathRendering()->stencilPath(path, stencilSettings); | 298 this->pathRendering()->stencilPath(path, stencilSettings); |
| 296 } | 299 } |
| 297 | 300 |
| 298 | 301 |
| 299 void GrGpu::drawPath(const GrOptDrawState& ds, | 302 void GrGpu::drawPath(const GrOptDrawState& ds, |
| 303 const GrProgramDesc& desc, |
| 300 const GrPath* path, | 304 const GrPath* path, |
| 301 const GrStencilSettings& stencilSettings) { | 305 const GrStencilSettings& stencilSettings) { |
| 302 this->handleDirtyContext(); | 306 this->handleDirtyContext(); |
| 303 | 307 |
| 304 if (!this->flushGraphicsState(ds, kDrawPath_DrawType)) { | 308 if (!this->flushGraphicsState(ds, desc, kDrawPath_DrawType)) { |
| 305 return; | 309 return; |
| 306 } | 310 } |
| 307 | 311 |
| 308 this->pathRendering()->drawPath(path, stencilSettings); | 312 this->pathRendering()->drawPath(path, stencilSettings); |
| 309 } | 313 } |
| 310 | 314 |
| 311 void GrGpu::drawPaths(const GrOptDrawState& ds, | 315 void GrGpu::drawPaths(const GrOptDrawState& ds, |
| 316 const GrProgramDesc& desc, |
| 312 const GrPathRange* pathRange, | 317 const GrPathRange* pathRange, |
| 313 const void* indices, | 318 const void* indices, |
| 314 GrDrawTarget::PathIndexType indexType, | 319 GrDrawTarget::PathIndexType indexType, |
| 315 const float transformValues[], | 320 const float transformValues[], |
| 316 GrDrawTarget::PathTransformType transformType, | 321 GrDrawTarget::PathTransformType transformType, |
| 317 int count, | 322 int count, |
| 318 const GrStencilSettings& stencilSettings) { | 323 const GrStencilSettings& stencilSettings) { |
| 319 this->handleDirtyContext(); | 324 this->handleDirtyContext(); |
| 320 | 325 |
| 321 if (!this->flushGraphicsState(ds, kDrawPaths_DrawType)) { | 326 if (!this->flushGraphicsState(ds, desc, kDrawPaths_DrawType)) { |
| 322 return; | 327 return; |
| 323 } | 328 } |
| 324 | 329 |
| 325 pathRange->willDrawPaths(indices, indexType, count); | 330 pathRange->willDrawPaths(indices, indexType, count); |
| 326 this->pathRendering()->drawPaths(pathRange, indices, indexType, transformVal
ues, | 331 this->pathRendering()->drawPaths(pathRange, indices, indexType, transformVal
ues, |
| 327 transformType, count, stencilSettings); | 332 transformType, count, stencilSettings); |
| 328 } | 333 } |
| OLD | NEW |