| 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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 int left, int top, int width, int height, | 474 int left, int top, int width, int height, |
| 475 GrPixelConfig config, const void* buffer, | 475 GrPixelConfig config, const void* buffer, |
| 476 size_t rowBytes) = 0; | 476 size_t rowBytes) = 0; |
| 477 | 477 |
| 478 // overridden by backend-specific derived class to perform the resolve | 478 // overridden by backend-specific derived class to perform the resolve |
| 479 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; | 479 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; |
| 480 | 480 |
| 481 // width and height may be larger than rt (if underlying API allows it). | 481 // width and height may be larger than rt (if underlying API allows it). |
| 482 // Should attach the SB to the RT. Returns false if compatible sb could | 482 // Should attach the SB to the RT. Returns false if compatible sb could |
| 483 // not be created. | 483 // not be created. |
| 484 virtual bool createStencilBufferForRenderTarget(GrRenderTarget*, bool budget
ed, | 484 virtual bool createStencilBufferForRenderTarget(GrRenderTarget*, int width,
int height) = 0; |
| 485 int width, int height) = 0; | |
| 486 | 485 |
| 487 // attaches an existing SB to an existing RT. | 486 // attaches an existing SB to an existing RT. |
| 488 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar
get*) = 0; | 487 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar
get*) = 0; |
| 489 | 488 |
| 490 // clears target's entire stencil buffer to 0 | 489 // clears target's entire stencil buffer to 0 |
| 491 virtual void clearStencil(GrRenderTarget* target) = 0; | 490 virtual void clearStencil(GrRenderTarget* target) = 0; |
| 492 | 491 |
| 493 // Given a rt, find or create a stencil buffer and attach it | 492 // Given a rt, find or create a stencil buffer and attach it |
| 494 bool attachStencilBufferToRenderTarget(GrRenderTarget* target, bool budgeted
); | 493 bool attachStencilBufferToRenderTarget(GrRenderTarget* target); |
| 495 | 494 |
| 496 virtual void didAddGpuTraceMarker() = 0; | 495 virtual void didAddGpuTraceMarker() = 0; |
| 497 virtual void didRemoveGpuTraceMarker() = 0; | 496 virtual void didRemoveGpuTraceMarker() = 0; |
| 498 | 497 |
| 499 void resetContext() { | 498 void resetContext() { |
| 500 this->onResetContext(fResetBits); | 499 this->onResetContext(fResetBits); |
| 501 fResetBits = 0; | 500 fResetBits = 0; |
| 502 ++fResetTimestamp; | 501 ++fResetTimestamp; |
| 503 } | 502 } |
| 504 | 503 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 516 int fGpuTrac
eMarkerCount; | 515 int fGpuTrac
eMarkerCount; |
| 517 GrTraceMarkerSet fActiveT
raceMarkers; | 516 GrTraceMarkerSet fActiveT
raceMarkers; |
| 518 GrTraceMarkerSet fStoredT
raceMarkers; | 517 GrTraceMarkerSet fStoredT
raceMarkers; |
| 519 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 518 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
| 520 GrContext* fContext
; | 519 GrContext* fContext
; |
| 521 | 520 |
| 522 typedef SkRefCnt INHERITED; | 521 typedef SkRefCnt INHERITED; |
| 523 }; | 522 }; |
| 524 | 523 |
| 525 #endif | 524 #endif |
| OLD | NEW |