| 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 virtual 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) = 0; |
| 301 | 301 |
| 302 // Called before certain draws in order to guarantee coherent results from d
st reads. | |
| 303 virtual void xferBarrier(GrRenderTarget*, GrXferBarrierType) = 0; | |
| 304 | |
| 305 struct DrawArgs { | 302 struct DrawArgs { |
| 306 DrawArgs(const GrPrimitiveProcessor* primProc, | 303 DrawArgs(const GrPrimitiveProcessor* primProc, |
| 307 const GrPipeline* pipeline, | 304 const GrPipeline* pipeline, |
| 308 const GrProgramDesc* desc, | 305 const GrProgramDesc* desc, |
| 309 const GrBatchTracker* batchTracker) | 306 const GrBatchTracker* batchTracker) |
| 310 : fPrimitiveProcessor(primProc) | 307 : fPrimitiveProcessor(primProc) |
| 311 , fPipeline(pipeline) | 308 , fPipeline(pipeline) |
| 312 , fDesc(desc) | 309 , fDesc(desc) |
| 313 , fBatchTracker(batchTracker) { | 310 , fBatchTracker(batchTracker) { |
| 314 SkASSERT(primProc && pipeline && desc && batchTracker); | 311 SkASSERT(primProc && pipeline && desc && batchTracker); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 Stats fStats; | 422 Stats fStats; |
| 426 SkAutoTDelete<GrPathRendering> fPathRendering; | 423 SkAutoTDelete<GrPathRendering> fPathRendering; |
| 427 // Subclass must initialize this in its constructor. | 424 // Subclass must initialize this in its constructor. |
| 428 SkAutoTUnref<const GrCaps> fCaps; | 425 SkAutoTUnref<const GrCaps> fCaps; |
| 429 | 426 |
| 430 private: | 427 private: |
| 431 // called when the 3D context state is unknown. Subclass should emit any | 428 // called when the 3D context state is unknown. Subclass should emit any |
| 432 // assumed 3D context state and dirty any state cache. | 429 // assumed 3D context state and dirty any state cache. |
| 433 virtual void onResetContext(uint32_t resetBits) = 0; | 430 virtual void onResetContext(uint32_t resetBits) = 0; |
| 434 | 431 |
| 432 // Called before certain draws in order to guarantee coherent results from d
st reads. |
| 433 virtual void xferBarrier(GrRenderTarget*, GrXferBarrierType) = 0; |
| 434 |
| 435 // overridden by backend-specific derived class to create objects. | 435 // overridden by backend-specific derived class to create objects. |
| 436 // Texture size and sample size will have already been validated in base cla
ss before | 436 // Texture size and sample size will have already been validated in base cla
ss before |
| 437 // onCreateTexture/CompressedTexture are called. | 437 // onCreateTexture/CompressedTexture are called. |
| 438 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc, | 438 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc, |
| 439 GrGpuResource::LifeCycle lifeCycle, | 439 GrGpuResource::LifeCycle lifeCycle, |
| 440 const void* srcData, size_t rowBytes) = 0
; | 440 const void* srcData, size_t rowBytes) = 0
; |
| 441 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 441 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
| 442 GrGpuResource::LifeCycle lifeCy
cle, | 442 GrGpuResource::LifeCycle lifeCy
cle, |
| 443 const void* srcData) = 0; | 443 const void* srcData) = 0; |
| 444 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; | 444 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 GrTraceMarkerSet fActiveT
raceMarkers; | 515 GrTraceMarkerSet fActiveT
raceMarkers; |
| 516 GrTraceMarkerSet fStoredT
raceMarkers; | 516 GrTraceMarkerSet fStoredT
raceMarkers; |
| 517 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 517 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
| 518 GrContext* fContext
; | 518 GrContext* fContext
; |
| 519 | 519 |
| 520 friend class GrPathRendering; | 520 friend class GrPathRendering; |
| 521 typedef SkRefCnt INHERITED; | 521 typedef SkRefCnt INHERITED; |
| 522 }; | 522 }; |
| 523 | 523 |
| 524 #endif | 524 #endif |
| OLD | NEW |