| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 virtual void buildProgramDesc(GrProgramDesc*, | 288 virtual void buildProgramDesc(GrProgramDesc*, |
| 289 const GrPrimitiveProcessor&, | 289 const GrPrimitiveProcessor&, |
| 290 const GrPipeline&, | 290 const GrPipeline&, |
| 291 const GrBatchTracker&) const = 0; | 291 const GrBatchTracker&) const = 0; |
| 292 | 292 |
| 293 // Called to perform a surface to surface copy. Fallbacks to issuing a draw
from the src to dst | 293 // Called to perform a surface to surface copy. Fallbacks to issuing a draw
from the src to dst |
| 294 // take place at the GrDrawTarget level and this function implement faster c
opy paths. The rect | 294 // take place at the GrDrawTarget level and this function implement faster c
opy paths. The rect |
| 295 // and point are pre-clipped. The src rect and implied dst rect are guarante
ed to be within the | 295 // and point are pre-clipped. The src rect and implied dst rect are guarante
ed to be within the |
| 296 // src/dst bounds and non-empty. | 296 // src/dst bounds and non-empty. |
| 297 virtual bool copySurface(GrSurface* dst, | 297 bool copySurface(GrSurface* dst, |
| 298 GrSurface* src, | 298 GrSurface* src, |
| 299 const SkIRect& srcRect, | 299 const SkIRect& srcRect, |
| 300 const SkIPoint& dstPoint) = 0; | 300 const SkIPoint& dstPoint); |
| 301 | 301 |
| 302 struct DrawArgs { | 302 struct DrawArgs { |
| 303 DrawArgs(const GrPrimitiveProcessor* primProc, | 303 DrawArgs(const GrPrimitiveProcessor* primProc, |
| 304 const GrPipeline* pipeline, | 304 const GrPipeline* pipeline, |
| 305 const GrProgramDesc* desc, | 305 const GrProgramDesc* desc, |
| 306 const GrBatchTracker* batchTracker) | 306 const GrBatchTracker* batchTracker) |
| 307 : fPrimitiveProcessor(primProc) | 307 : fPrimitiveProcessor(primProc) |
| 308 , fPipeline(pipeline) | 308 , fPipeline(pipeline) |
| 309 , fDesc(desc) | 309 , fDesc(desc) |
| 310 , fBatchTracker(batchTracker) { | 310 , fBatchTracker(batchTracker) { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 | 475 |
| 476 // overridden by backend-specific derived class to perform the surface write | 476 // overridden by backend-specific derived class to perform the surface write |
| 477 virtual bool onWritePixels(GrSurface*, | 477 virtual bool onWritePixels(GrSurface*, |
| 478 int left, int top, int width, int height, | 478 int left, int top, int width, int height, |
| 479 GrPixelConfig config, const void* buffer, | 479 GrPixelConfig config, const void* buffer, |
| 480 size_t rowBytes) = 0; | 480 size_t rowBytes) = 0; |
| 481 | 481 |
| 482 // overridden by backend-specific derived class to perform the resolve | 482 // overridden by backend-specific derived class to perform the resolve |
| 483 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; | 483 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; |
| 484 | 484 |
| 485 // overridden by backend specific derived class to perform the copy surface |
| 486 virtual bool onCopySurface(GrSurface* dst, |
| 487 GrSurface* src, |
| 488 const SkIRect& srcRect, |
| 489 const SkIPoint& dstPoint) = 0; |
| 490 |
| 485 // width and height may be larger than rt (if underlying API allows it). | 491 // width and height may be larger than rt (if underlying API allows it). |
| 486 // Should attach the SB to the RT. Returns false if compatible sb could | 492 // Should attach the SB to the RT. Returns false if compatible sb could |
| 487 // not be created. | 493 // not be created. |
| 488 virtual bool createStencilAttachmentForRenderTarget(GrRenderTarget*, int wid
th, int height) = 0; | 494 virtual bool createStencilAttachmentForRenderTarget(GrRenderTarget*, int wid
th, int height) = 0; |
| 489 | 495 |
| 490 // attaches an existing SB to an existing RT. | 496 // attaches an existing SB to an existing RT. |
| 491 virtual bool attachStencilAttachmentToRenderTarget(GrStencilAttachment*, GrR
enderTarget*) = 0; | 497 virtual bool attachStencilAttachmentToRenderTarget(GrStencilAttachment*, GrR
enderTarget*) = 0; |
| 492 | 498 |
| 493 // clears target's entire stencil buffer to 0 | 499 // clears target's entire stencil buffer to 0 |
| 494 virtual void clearStencil(GrRenderTarget* target) = 0; | 500 virtual void clearStencil(GrRenderTarget* target) = 0; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 515 GrTraceMarkerSet fActiveT
raceMarkers; | 521 GrTraceMarkerSet fActiveT
raceMarkers; |
| 516 GrTraceMarkerSet fStoredT
raceMarkers; | 522 GrTraceMarkerSet fStoredT
raceMarkers; |
| 517 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 523 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
| 518 GrContext* fContext
; | 524 GrContext* fContext
; |
| 519 | 525 |
| 520 friend class GrPathRendering; | 526 friend class GrPathRendering; |
| 521 typedef SkRefCnt INHERITED; | 527 typedef SkRefCnt INHERITED; |
| 522 }; | 528 }; |
| 523 | 529 |
| 524 #endif | 530 #endif |
| OLD | NEW |