| 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 int left, int top, int width, int height, | 462 int left, int top, int width, int height, |
| 463 GrPixelConfig config, const void* buffer, | 463 GrPixelConfig config, const void* buffer, |
| 464 size_t rowBytes) = 0; | 464 size_t rowBytes) = 0; |
| 465 | 465 |
| 466 // overridden by backend-specific derived class to perform the resolve | 466 // overridden by backend-specific derived class to perform the resolve |
| 467 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; | 467 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; |
| 468 | 468 |
| 469 // width and height may be larger than rt (if underlying API allows it). | 469 // width and height may be larger than rt (if underlying API allows it). |
| 470 // Should attach the SB to the RT. Returns false if compatible sb could | 470 // Should attach the SB to the RT. Returns false if compatible sb could |
| 471 // not be created. | 471 // not be created. |
| 472 virtual bool createStencilBufferForRenderTarget(GrRenderTarget*, int width,
int height) = 0; | 472 virtual bool createStencilBufferForRenderTarget(GrRenderTarget*, bool budget
ed, |
| 473 int width, int height) = 0; |
| 473 | 474 |
| 474 // attaches an existing SB to an existing RT. | 475 // attaches an existing SB to an existing RT. |
| 475 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar
get*) = 0; | 476 virtual bool attachStencilBufferToRenderTarget(GrStencilBuffer*, GrRenderTar
get*) = 0; |
| 476 | 477 |
| 477 // clears target's entire stencil buffer to 0 | 478 // clears target's entire stencil buffer to 0 |
| 478 virtual void clearStencil(GrRenderTarget* target) = 0; | 479 virtual void clearStencil(GrRenderTarget* target) = 0; |
| 479 | 480 |
| 480 // Given a rt, find or create a stencil buffer and attach it | 481 // Given a rt, find or create a stencil buffer and attach it |
| 481 bool attachStencilBufferToRenderTarget(GrRenderTarget* target); | 482 bool attachStencilBufferToRenderTarget(GrRenderTarget* target, bool budgeted
); |
| 482 | 483 |
| 483 virtual void didAddGpuTraceMarker() = 0; | 484 virtual void didAddGpuTraceMarker() = 0; |
| 484 virtual void didRemoveGpuTraceMarker() = 0; | 485 virtual void didRemoveGpuTraceMarker() = 0; |
| 485 | 486 |
| 486 void resetContext() { | 487 void resetContext() { |
| 487 this->onResetContext(fResetBits); | 488 this->onResetContext(fResetBits); |
| 488 fResetBits = 0; | 489 fResetBits = 0; |
| 489 ++fResetTimestamp; | 490 ++fResetTimestamp; |
| 490 } | 491 } |
| 491 | 492 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 503 int fGpuTrac
eMarkerCount; | 504 int fGpuTrac
eMarkerCount; |
| 504 GrTraceMarkerSet fActiveT
raceMarkers; | 505 GrTraceMarkerSet fActiveT
raceMarkers; |
| 505 GrTraceMarkerSet fStoredT
raceMarkers; | 506 GrTraceMarkerSet fStoredT
raceMarkers; |
| 506 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 507 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
| 507 GrContext* fContext
; | 508 GrContext* fContext
; |
| 508 | 509 |
| 509 typedef SkRefCnt INHERITED; | 510 typedef SkRefCnt INHERITED; |
| 510 }; | 511 }; |
| 511 | 512 |
| 512 #endif | 513 #endif |
| OLD | NEW |