| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 * @ return the quad index buffer | 134 * @ return the quad index buffer |
| 135 */ | 135 */ |
| 136 const GrIndexBuffer* getQuadIndexBuffer() const; | 136 const GrIndexBuffer* getQuadIndexBuffer() const; |
| 137 | 137 |
| 138 /** | 138 /** |
| 139 * Resolves MSAA. | 139 * Resolves MSAA. |
| 140 */ | 140 */ |
| 141 void resolveRenderTarget(GrRenderTarget* target); | 141 void resolveRenderTarget(GrRenderTarget* target); |
| 142 | 142 |
| 143 /** | 143 /** |
| 144 * Ensures that the current render target is actually set in the | |
| 145 * underlying 3D API. Used when client wants to use 3D API to directly | |
| 146 * render to the RT. | |
| 147 */ | |
| 148 void forceRenderTargetFlush(); | |
| 149 | |
| 150 /** | |
| 151 * Gets a preferred 8888 config to use for writing/reading pixel data to/fro
m a surface with | 144 * Gets a preferred 8888 config to use for writing/reading pixel data to/fro
m a surface with |
| 152 * config surfaceConfig. The returned config must have at least as many bits
per channel as the | 145 * config surfaceConfig. The returned config must have at least as many bits
per channel as the |
| 153 * readConfig or writeConfig param. | 146 * readConfig or writeConfig param. |
| 154 */ | 147 */ |
| 155 virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig readConfig, | 148 virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig readConfig, |
| 156 GrPixelConfig surfaceConfig)
const { | 149 GrPixelConfig surfaceConfig)
const { |
| 157 return readConfig; | 150 return readConfig; |
| 158 } | 151 } |
| 159 virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig writeConfig, | 152 virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig writeConfig, |
| 160 GrPixelConfig surfaceConfig
) const { | 153 GrPixelConfig surfaceConfig
) const { |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 428 |
| 436 // overridden by backend-specific derived class to perform the draw call. | 429 // overridden by backend-specific derived class to perform the draw call. |
| 437 virtual void onGpuDraw(const DrawInfo&) = 0; | 430 virtual void onGpuDraw(const DrawInfo&) = 0; |
| 438 | 431 |
| 439 // overridden by backend-specific derived class to perform the path stencili
ng. | 432 // overridden by backend-specific derived class to perform the path stencili
ng. |
| 440 virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) = 0; | 433 virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) = 0; |
| 441 virtual void onGpuDrawPath(const GrPath*, SkPath::FillType) = 0; | 434 virtual void onGpuDrawPath(const GrPath*, SkPath::FillType) = 0; |
| 442 virtual void onGpuDrawPaths(size_t, const GrPath**, const SkMatrix*, | 435 virtual void onGpuDrawPaths(size_t, const GrPath**, const SkMatrix*, |
| 443 SkPath::FillType, SkStrokeRec::Style) = 0; | 436 SkPath::FillType, SkStrokeRec::Style) = 0; |
| 444 | 437 |
| 445 // overridden by backend-specific derived class to perform flush | |
| 446 virtual void onForceRenderTargetFlush() = 0; | |
| 447 | |
| 448 // overridden by backend-specific derived class to perform the read pixels. | 438 // overridden by backend-specific derived class to perform the read pixels. |
| 449 virtual bool onReadPixels(GrRenderTarget* target, | 439 virtual bool onReadPixels(GrRenderTarget* target, |
| 450 int left, int top, int width, int height, | 440 int left, int top, int width, int height, |
| 451 GrPixelConfig, | 441 GrPixelConfig, |
| 452 void* buffer, | 442 void* buffer, |
| 453 size_t rowBytes) = 0; | 443 size_t rowBytes) = 0; |
| 454 | 444 |
| 455 // overridden by backend-specific derived class to perform the texture updat
e | 445 // overridden by backend-specific derived class to perform the texture updat
e |
| 456 virtual bool onWriteTexturePixels(GrTexture* texture, | 446 virtual bool onWriteTexturePixels(GrTexture* texture, |
| 457 int left, int top, int width, int height, | 447 int left, int top, int width, int height, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 // these are mutable so they can be created on-demand | 515 // these are mutable so they can be created on-demand |
| 526 mutable GrIndexBuffer* fQuadInd
exBuffer; | 516 mutable GrIndexBuffer* fQuadInd
exBuffer; |
| 527 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his | 517 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his |
| 528 // functionality to GrResourceCache. | 518 // functionality to GrResourceCache. |
| 529 ResourceList fResourc
eList; | 519 ResourceList fResourc
eList; |
| 530 | 520 |
| 531 typedef GrDrawTarget INHERITED; | 521 typedef GrDrawTarget INHERITED; |
| 532 }; | 522 }; |
| 533 | 523 |
| 534 #endif | 524 #endif |
| OLD | NEW |