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