| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 /** | 258 /** |
| 259 * Remove resource from list of resources. Should only be called by | 259 * Remove resource from list of resources. Should only be called by |
| 260 * GrResource. | 260 * GrResource. |
| 261 * @param resource the resource to remove. | 261 * @param resource the resource to remove. |
| 262 */ | 262 */ |
| 263 void removeResource(GrResource* resource); | 263 void removeResource(GrResource* resource); |
| 264 | 264 |
| 265 // GrDrawTarget overrides | 265 // GrDrawTarget overrides |
| 266 virtual void clear(const SkIRect* rect, | 266 virtual void clear(const SkIRect* rect, |
| 267 GrColor color, | 267 GrColor color, |
| 268 bool canIgnoreRect, |
| 268 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; | 269 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; |
| 269 | 270 |
| 270 virtual void purgeResources() SK_OVERRIDE { | 271 virtual void purgeResources() SK_OVERRIDE { |
| 271 // The clip mask manager can rebuild all its clip masks so just | 272 // The clip mask manager can rebuild all its clip masks so just |
| 272 // get rid of them all. | 273 // get rid of them all. |
| 273 fClipMaskManager.releaseResources(); | 274 fClipMaskManager.releaseResources(); |
| 274 } | 275 } |
| 275 | 276 |
| 276 // After the client interacts directly with the 3D context state the GrGpu | 277 // After the client interacts directly with the 3D context state the GrGpu |
| 277 // must resync its internal state and assumptions about 3D context state. | 278 // must resync its internal state and assumptions about 3D context state. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, | 420 virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, |
| 420 const void* srcData, | 421 const void* srcData, |
| 421 size_t rowBytes) = 0; | 422 size_t rowBytes) = 0; |
| 422 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0; | 423 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0; |
| 423 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&) = 0; | 424 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&) = 0; |
| 424 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; | 425 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; |
| 425 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; | 426 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; |
| 426 virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0; | 427 virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0; |
| 427 | 428 |
| 428 // overridden by backend-specific derived class to perform the clear and | 429 // overridden by backend-specific derived class to perform the clear and |
| 429 // clearRect. NULL rect means clear whole target. | 430 // clearRect. NULL rect means clear whole target. If canIgnoreRect is |
| 430 virtual void onClear(const SkIRect* rect, GrColor color) = 0; | 431 // true, it is okay to perform a full clear instead of a partial clear |
| 432 virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect)
= 0; |
| 431 | 433 |
| 432 // overridden by backend-specific derived class to perform the draw call. | 434 // overridden by backend-specific derived class to perform the draw call. |
| 433 virtual void onGpuDraw(const DrawInfo&) = 0; | 435 virtual void onGpuDraw(const DrawInfo&) = 0; |
| 434 | 436 |
| 435 // overridden by backend-specific derived class to perform the path stencili
ng. | 437 // overridden by backend-specific derived class to perform the path stencili
ng. |
| 436 virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) = 0; | 438 virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) = 0; |
| 437 virtual void onGpuDrawPath(const GrPath*, SkPath::FillType) = 0; | 439 virtual void onGpuDrawPath(const GrPath*, SkPath::FillType) = 0; |
| 438 | 440 |
| 439 // overridden by backend-specific derived class to perform flush | 441 // overridden by backend-specific derived class to perform flush |
| 440 virtual void onForceRenderTargetFlush() = 0; | 442 virtual void onForceRenderTargetFlush() = 0; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 // these are mutable so they can be created on-demand | 518 // these are mutable so they can be created on-demand |
| 517 mutable GrIndexBuffer* fQuadInd
exBuffer; | 519 mutable GrIndexBuffer* fQuadInd
exBuffer; |
| 518 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his | 520 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his |
| 519 // functionality to GrResourceCache. | 521 // functionality to GrResourceCache. |
| 520 ResourceList fResourc
eList; | 522 ResourceList fResourc
eList; |
| 521 | 523 |
| 522 typedef GrDrawTarget INHERITED; | 524 typedef GrDrawTarget INHERITED; |
| 523 }; | 525 }; |
| 524 | 526 |
| 525 #endif | 527 #endif |
| OLD | NEW |