| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 /** | 99 /** |
| 100 * Creates a vertex buffer. | 100 * Creates a vertex buffer. |
| 101 * | 101 * |
| 102 * @param size size in bytes of the vertex buffer | 102 * @param size size in bytes of the vertex buffer |
| 103 * @param dynamic hints whether the data will be frequently changed | 103 * @param dynamic hints whether the data will be frequently changed |
| 104 * by either GrVertexBuffer::lock or | 104 * by either GrVertexBuffer::lock or |
| 105 * GrVertexBuffer::updateData. | 105 * GrVertexBuffer::updateData. |
| 106 * | 106 * |
| 107 * @return The vertex buffer if successful, otherwise NULL. | 107 * @return The vertex buffer if successful, otherwise NULL. |
| 108 */ | 108 */ |
| 109 GrVertexBuffer* createVertexBuffer(uint32_t size, bool dynamic); | 109 GrVertexBuffer* createVertexBuffer(size_t size, bool dynamic); |
| 110 | 110 |
| 111 /** | 111 /** |
| 112 * Creates an index buffer. | 112 * Creates an index buffer. |
| 113 * | 113 * |
| 114 * @param size size in bytes of the index buffer | 114 * @param size size in bytes of the index buffer |
| 115 * @param dynamic hints whether the data will be frequently changed | 115 * @param dynamic hints whether the data will be frequently changed |
| 116 * by either GrIndexBuffer::lock or | 116 * by either GrIndexBuffer::lock or |
| 117 * GrIndexBuffer::updateData. | 117 * GrIndexBuffer::updateData. |
| 118 * | 118 * |
| 119 * @return The index buffer if successful, otherwise NULL. | 119 * @return The index buffer if successful, otherwise NULL. |
| 120 */ | 120 */ |
| 121 GrIndexBuffer* createIndexBuffer(uint32_t size, bool dynamic); | 121 GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic); |
| 122 | 122 |
| 123 /** | 123 /** |
| 124 * Creates a path object that can be stenciled using stencilPath(). It is | 124 * Creates a path object that can be stenciled using stencilPath(). It is |
| 125 * only legal to call this if the caps report support for path stenciling. | 125 * only legal to call this if the caps report support for path stenciling. |
| 126 */ | 126 */ |
| 127 GrPath* createPath(const SkPath& path, const SkStrokeRec& stroke); | 127 GrPath* createPath(const SkPath& path, const SkStrokeRec& stroke); |
| 128 | 128 |
| 129 /** | 129 /** |
| 130 * Returns an index buffer that can be used to render quads. | 130 * Returns an index buffer that can be used to render quads. |
| 131 * Six indices per quad: 0, 1, 2, 0, 2, 3, etc. | 131 * Six indices per quad: 0, 1, 2, 0, 2, 3, etc. |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // called when the 3D context state is unknown. Subclass should emit any | 414 // called when the 3D context state is unknown. Subclass should emit any |
| 415 // assumed 3D context state and dirty any state cache. | 415 // assumed 3D context state and dirty any state cache. |
| 416 virtual void onResetContext(uint32_t resetBits) = 0; | 416 virtual void onResetContext(uint32_t resetBits) = 0; |
| 417 | 417 |
| 418 // overridden by backend-specific derived class to create objects. | 418 // overridden by backend-specific derived class to create objects. |
| 419 virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, | 419 virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, |
| 420 const void* srcData, | 420 const void* srcData, |
| 421 size_t rowBytes) = 0; | 421 size_t rowBytes) = 0; |
| 422 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0; | 422 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0; |
| 423 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&) = 0; | 423 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&) = 0; |
| 424 virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size, bool dynamic) =
0; | 424 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; |
| 425 virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size, bool dynamic) = 0; | 425 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; |
| 426 virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0; | 426 virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0; |
| 427 | 427 |
| 428 // overridden by backend-specific derived class to perform the clear and | 428 // overridden by backend-specific derived class to perform the clear and |
| 429 // clearRect. NULL rect means clear whole target. | 429 // clearRect. NULL rect means clear whole target. |
| 430 virtual void onClear(const SkIRect* rect, GrColor color) = 0; | 430 virtual void onClear(const SkIRect* rect, GrColor color) = 0; |
| 431 | 431 |
| 432 // overridden by backend-specific derived class to perform the draw call. | 432 // overridden by backend-specific derived class to perform the draw call. |
| 433 virtual void onGpuDraw(const DrawInfo&) = 0; | 433 virtual void onGpuDraw(const DrawInfo&) = 0; |
| 434 | 434 |
| 435 // overridden by backend-specific derived class to perform the path stencili
ng. | 435 // overridden by backend-specific derived class to perform the path stencili
ng. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 // these are mutable so they can be created on-demand | 516 // these are mutable so they can be created on-demand |
| 517 mutable GrIndexBuffer* fQuadInd
exBuffer; | 517 mutable GrIndexBuffer* fQuadInd
exBuffer; |
| 518 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his | 518 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his |
| 519 // functionality to GrResourceCache. | 519 // functionality to GrResourceCache. |
| 520 ResourceList fResourc
eList; | 520 ResourceList fResourc
eList; |
| 521 | 521 |
| 522 typedef GrDrawTarget INHERITED; | 522 typedef GrDrawTarget INHERITED; |
| 523 }; | 523 }; |
| 524 | 524 |
| 525 #endif | 525 #endif |
| OLD | NEW |