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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 429 |
430 | 430 |
431 // Overridden by backend specific classes to perform a clear of the stencil
clip bits. This is | 431 // Overridden by backend specific classes to perform a clear of the stencil
clip bits. This is |
432 // ONLY used by the the clip target | 432 // ONLY used by the the clip target |
433 virtual void onClearStencilClip(GrRenderTarget*, | 433 virtual void onClearStencilClip(GrRenderTarget*, |
434 const SkIRect& rect, | 434 const SkIRect& rect, |
435 bool insideClip) = 0; | 435 bool insideClip) = 0; |
436 | 436 |
437 // overridden by backend-specific derived class to perform the draw call. | 437 // overridden by backend-specific derived class to perform the draw call. |
438 virtual void onDraw(const GrOptDrawState&, const GrDrawTarget::DrawInfo&) =
0; | 438 virtual void onDraw(const GrOptDrawState&, const GrDrawTarget::DrawInfo&) =
0; |
| 439 virtual void onStencilPath(const GrOptDrawState&, const GrPath*, const GrSte
ncilSettings&) = 0; |
| 440 virtual void onDrawPath(const GrOptDrawState&, const GrPath*, const GrStenci
lSettings&) = 0; |
| 441 virtual void onDrawPaths(const GrOptDrawState&, |
| 442 const GrPathRange*, |
| 443 const void* indices, |
| 444 GrDrawTarget::PathIndexType, |
| 445 const float transformValues[], |
| 446 GrDrawTarget::PathTransformType, |
| 447 int count, |
| 448 const GrStencilSettings&) = 0; |
439 | 449 |
440 // overridden by backend-specific derived class to perform the read pixels. | 450 // overridden by backend-specific derived class to perform the read pixels. |
441 virtual bool onReadPixels(GrRenderTarget* target, | 451 virtual bool onReadPixels(GrRenderTarget* target, |
442 int left, int top, int width, int height, | 452 int left, int top, int width, int height, |
443 GrPixelConfig, | 453 GrPixelConfig, |
444 void* buffer, | 454 void* buffer, |
445 size_t rowBytes) = 0; | 455 size_t rowBytes) = 0; |
446 | 456 |
447 // overridden by backend-specific derived class to perform the texture updat
e | 457 // overridden by backend-specific derived class to perform the texture updat
e |
448 virtual bool onWriteTexturePixels(GrTexture* texture, | 458 virtual bool onWriteTexturePixels(GrTexture* texture, |
449 int left, int top, int width, int height, | 459 int left, int top, int width, int height, |
450 GrPixelConfig config, const void* buffer, | 460 GrPixelConfig config, const void* buffer, |
451 size_t rowBytes) = 0; | 461 size_t rowBytes) = 0; |
452 | 462 |
453 // overridden by backend-specific derived class to perform the resolve | 463 // overridden by backend-specific derived class to perform the resolve |
454 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; | 464 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; |
455 | 465 |
456 // width and height may be larger than rt (if underlying API allows it). | 466 // width and height may be larger than rt (if underlying API allows it). |
457 // Should attach the SB to the RT. Returns false if compatible sb could | 467 // Should attach the SB to the RT. Returns false if compatible sb could |
458 // not be created. | 468 // not be created. |
459 virtual bool createStencilBufferForRenderTarget(GrRenderTarget*, int width,
int height) = 0; | 469 virtual bool createStencilBufferForRenderTarget(GrRenderTarget*, int width,
int height) = 0; |
460 | 470 |
461 // attaches an existing SB to an existing RT. | 471 // attaches an existing SB to an existing RT. |
462 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar
get*) = 0; | 472 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar
get*) = 0; |
463 | 473 |
464 // The GrGpu typically records the clients requested state and then flushes | |
465 // deltas from previous state at draw time. This function does the | |
466 // backend-specific flush of the state. | |
467 // returns false if current state is unsupported. | |
468 virtual bool flushGraphicsState(const GrOptDrawState&) = 0; | |
469 | |
470 // clears target's entire stencil buffer to 0 | 474 // clears target's entire stencil buffer to 0 |
471 virtual void clearStencil(GrRenderTarget* target) = 0; | 475 virtual void clearStencil(GrRenderTarget* target) = 0; |
472 | 476 |
473 // Given a rt, find or create a stencil buffer and attach it | 477 // Given a rt, find or create a stencil buffer and attach it |
474 bool attachStencilBufferToRenderTarget(GrRenderTarget* target); | 478 bool attachStencilBufferToRenderTarget(GrRenderTarget* target); |
475 | 479 |
476 virtual void didAddGpuTraceMarker() = 0; | 480 virtual void didAddGpuTraceMarker() = 0; |
477 virtual void didRemoveGpuTraceMarker() = 0; | 481 virtual void didRemoveGpuTraceMarker() = 0; |
478 | 482 |
479 void resetContext() { | 483 void resetContext() { |
(...skipping 16 matching lines...) Expand all Loading... |
496 int fGpuTrac
eMarkerCount; | 500 int fGpuTrac
eMarkerCount; |
497 GrTraceMarkerSet fActiveT
raceMarkers; | 501 GrTraceMarkerSet fActiveT
raceMarkers; |
498 GrTraceMarkerSet fStoredT
raceMarkers; | 502 GrTraceMarkerSet fStoredT
raceMarkers; |
499 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 503 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
500 GrContext* fContext
; | 504 GrContext* fContext
; |
501 | 505 |
502 typedef SkRefCnt INHERITED; | 506 typedef SkRefCnt INHERITED; |
503 }; | 507 }; |
504 | 508 |
505 #endif | 509 #endif |
OLD | NEW |