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