OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrGpu_DEFINED | 8 #ifndef GrGpu_DEFINED |
9 #define GrGpu_DEFINED | 9 #define GrGpu_DEFINED |
10 | 10 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 349 |
350 // This method is called by copySurface The srcRect is guaranteed to be ent
irely within the | 350 // This method is called by copySurface The srcRect is guaranteed to be ent
irely within the |
351 // src bounds. Likewise, the dst rect implied by dstPoint and srcRect's widt
h and height falls | 351 // src bounds. Likewise, the dst rect implied by dstPoint and srcRect's widt
h and height falls |
352 // entirely within the dst. The default implementation will draw a rect from
the src to the | 352 // entirely within the dst. The default implementation will draw a rect from
the src to the |
353 // dst if the src is a texture and the dst is a render target and fail other
wise. | 353 // dst if the src is a texture and the dst is a render target and fail other
wise. |
354 virtual bool copySurface(GrSurface* dst, | 354 virtual bool copySurface(GrSurface* dst, |
355 GrSurface* src, | 355 GrSurface* src, |
356 const SkIRect& srcRect, | 356 const SkIRect& srcRect, |
357 const SkIPoint& dstPoint) = 0; | 357 const SkIPoint& dstPoint) = 0; |
358 | 358 |
359 virtual void draw(const GrOptDrawState&, | 359 virtual void draw(const GrOptDrawState&, const GrDrawTarget::DrawInfo&); |
360 const GrDrawTarget::DrawInfo&, | |
361 const GrClipMaskManager::ScissorState&); | |
362 virtual void stencilPath(const GrOptDrawState&, | 360 virtual void stencilPath(const GrOptDrawState&, |
363 const GrPath*, | 361 const GrPath*, |
364 const GrClipMaskManager::ScissorState&, | |
365 const GrStencilSettings&); | 362 const GrStencilSettings&); |
366 virtual void drawPath(const GrOptDrawState&, | 363 virtual void drawPath(const GrOptDrawState&, |
367 const GrPath*, | 364 const GrPath*, |
368 const GrClipMaskManager::ScissorState&, | |
369 const GrStencilSettings&, | 365 const GrStencilSettings&, |
370 const GrDeviceCoordTexture* dstCopy); | 366 const GrDeviceCoordTexture* dstCopy); |
371 virtual void drawPaths(const GrOptDrawState&, | 367 virtual void drawPaths(const GrOptDrawState&, |
372 const GrPathRange*, | 368 const GrPathRange*, |
373 const uint32_t indices[], | 369 const uint32_t indices[], |
374 int count, | 370 int count, |
375 const float transforms[], | 371 const float transforms[], |
376 GrDrawTarget::PathTransformType, | 372 GrDrawTarget::PathTransformType, |
377 const GrClipMaskManager::ScissorState&, | |
378 const GrStencilSettings&, | 373 const GrStencilSettings&, |
379 const GrDeviceCoordTexture*); | 374 const GrDeviceCoordTexture*); |
380 | 375 |
381 static DrawType PrimTypeToDrawType(GrPrimitiveType type) { | 376 static DrawType PrimTypeToDrawType(GrPrimitiveType type) { |
382 switch (type) { | 377 switch (type) { |
383 case kTriangles_GrPrimitiveType: | 378 case kTriangles_GrPrimitiveType: |
384 case kTriangleStrip_GrPrimitiveType: | 379 case kTriangleStrip_GrPrimitiveType: |
385 case kTriangleFan_GrPrimitiveType: | 380 case kTriangleFan_GrPrimitiveType: |
386 return kDrawTriangles_DrawType; | 381 return kDrawTriangles_DrawType; |
387 case kPoints_GrPrimitiveType: | 382 case kPoints_GrPrimitiveType: |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 464 |
470 // attaches an existing SB to an existing RT. | 465 // attaches an existing SB to an existing RT. |
471 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar
get*) = 0; | 466 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar
get*) = 0; |
472 | 467 |
473 // The GrGpu typically records the clients requested state and then flushes | 468 // The GrGpu typically records the clients requested state and then flushes |
474 // deltas from previous state at draw time. This function does the | 469 // deltas from previous state at draw time. This function does the |
475 // backend-specific flush of the state. | 470 // backend-specific flush of the state. |
476 // returns false if current state is unsupported. | 471 // returns false if current state is unsupported. |
477 virtual bool flushGraphicsState(const GrOptDrawState&, | 472 virtual bool flushGraphicsState(const GrOptDrawState&, |
478 DrawType, | 473 DrawType, |
479 const GrClipMaskManager::ScissorState&, | |
480 const GrDeviceCoordTexture* dstCopy) = 0; | 474 const GrDeviceCoordTexture* dstCopy) = 0; |
481 | 475 |
482 // clears target's entire stencil buffer to 0 | 476 // clears target's entire stencil buffer to 0 |
483 virtual void clearStencil(GrRenderTarget* target) = 0; | 477 virtual void clearStencil(GrRenderTarget* target) = 0; |
484 | 478 |
485 // Given a rt, find or create a stencil buffer and attach it | 479 // Given a rt, find or create a stencil buffer and attach it |
486 bool attachStencilBufferToRenderTarget(GrRenderTarget* target); | 480 bool attachStencilBufferToRenderTarget(GrRenderTarget* target); |
487 | 481 |
488 virtual void didAddGpuTraceMarker() = 0; | 482 virtual void didAddGpuTraceMarker() = 0; |
489 virtual void didRemoveGpuTraceMarker() = 0; | 483 virtual void didRemoveGpuTraceMarker() = 0; |
(...skipping 18 matching lines...) Expand all Loading... |
508 int fGpuTrac
eMarkerCount; | 502 int fGpuTrac
eMarkerCount; |
509 GrTraceMarkerSet fActiveT
raceMarkers; | 503 GrTraceMarkerSet fActiveT
raceMarkers; |
510 GrTraceMarkerSet fStoredT
raceMarkers; | 504 GrTraceMarkerSet fStoredT
raceMarkers; |
511 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 505 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
512 GrContext* fContext
; | 506 GrContext* fContext
; |
513 | 507 |
514 typedef SkRefCnt INHERITED; | 508 typedef SkRefCnt INHERITED; |
515 }; | 509 }; |
516 | 510 |
517 #endif | 511 #endif |
OLD | NEW |