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