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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 4); | 278 4); |
279 } | 279 } |
280 | 280 |
281 return fQuadIndexBuffer; | 281 return fQuadIndexBuffer; |
282 } | 282 } |
283 | 283 |
284 //////////////////////////////////////////////////////////////////////////////// | 284 //////////////////////////////////////////////////////////////////////////////// |
285 | 285 |
286 void GrGpu::draw(const GrOptDrawState& ds, const GrDrawTarget::DrawInfo& info) { | 286 void GrGpu::draw(const GrOptDrawState& ds, const GrDrawTarget::DrawInfo& info) { |
287 this->handleDirtyContext(); | 287 this->handleDirtyContext(); |
288 if (!this->flushGraphicsState(ds, | 288 if (!this->flushGraphicsState(ds, PrimTypeToDrawType(info.primitiveType())))
{ |
289 PrimTypeToDrawType(info.primitiveType()), | |
290 info.getDstCopy())) { | |
291 return; | 289 return; |
292 } | 290 } |
293 this->onDraw(ds, info); | 291 this->onDraw(ds, info); |
294 } | 292 } |
295 | 293 |
296 void GrGpu::stencilPath(const GrOptDrawState& ds, | 294 void GrGpu::stencilPath(const GrOptDrawState& ds, |
297 const GrPath* path, | 295 const GrPath* path, |
298 const GrStencilSettings& stencilSettings) { | 296 const GrStencilSettings& stencilSettings) { |
299 this->handleDirtyContext(); | 297 this->handleDirtyContext(); |
300 | 298 |
301 if (!this->flushGraphicsState(ds, kStencilPath_DrawType, NULL)) { | 299 if (!this->flushGraphicsState(ds, kStencilPath_DrawType)) { |
302 return; | 300 return; |
303 } | 301 } |
304 | 302 |
305 this->pathRendering()->stencilPath(path, stencilSettings); | 303 this->pathRendering()->stencilPath(path, stencilSettings); |
306 } | 304 } |
307 | 305 |
308 | 306 |
309 void GrGpu::drawPath(const GrOptDrawState& ds, | 307 void GrGpu::drawPath(const GrOptDrawState& ds, |
310 const GrPath* path, | 308 const GrPath* path, |
311 const GrStencilSettings& stencilSettings, | 309 const GrStencilSettings& stencilSettings) { |
312 const GrDeviceCoordTexture* dstCopy) { | |
313 this->handleDirtyContext(); | 310 this->handleDirtyContext(); |
314 | 311 |
315 if (!this->flushGraphicsState(ds, kDrawPath_DrawType, dstCopy)) { | 312 if (!this->flushGraphicsState(ds, kDrawPath_DrawType)) { |
316 return; | 313 return; |
317 } | 314 } |
318 | 315 |
319 this->pathRendering()->drawPath(path, stencilSettings); | 316 this->pathRendering()->drawPath(path, stencilSettings); |
320 } | 317 } |
321 | 318 |
322 void GrGpu::drawPaths(const GrOptDrawState& ds, | 319 void GrGpu::drawPaths(const GrOptDrawState& ds, |
323 const GrPathRange* pathRange, | 320 const GrPathRange* pathRange, |
324 const uint32_t indices[], | 321 const uint32_t indices[], |
325 int count, | 322 int count, |
326 const float transforms[], | 323 const float transforms[], |
327 GrDrawTarget::PathTransformType transformsType, | 324 GrDrawTarget::PathTransformType transformsType, |
328 const GrStencilSettings& stencilSettings, | 325 const GrStencilSettings& stencilSettings) { |
329 const GrDeviceCoordTexture* dstCopy) { | |
330 this->handleDirtyContext(); | 326 this->handleDirtyContext(); |
331 | 327 |
332 if (!this->flushGraphicsState(ds, kDrawPaths_DrawType, dstCopy)) { | 328 if (!this->flushGraphicsState(ds, kDrawPaths_DrawType)) { |
333 return; | 329 return; |
334 } | 330 } |
335 | 331 |
336 pathRange->willDrawPaths(indices, count); | 332 pathRange->willDrawPaths(indices, count); |
337 this->pathRendering()->drawPaths(pathRange, indices, count, transforms, tran
sformsType, | 333 this->pathRendering()->drawPaths(pathRange, indices, count, transforms, tran
sformsType, |
338 stencilSettings); | 334 stencilSettings); |
339 } | 335 } |
OLD | NEW |