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 GrGLGpu_DEFINED | 8 #ifndef GrGLGpu_DEFINED |
9 #define GrGLGpu_DEFINED | 9 #define GrGLGpu_DEFINED |
10 | 10 |
11 #include "GrGLContext.h" | 11 #include "GrGLContext.h" |
12 #include "GrGLIRect.h" | 12 #include "GrGLIRect.h" |
13 #include "GrGLIndexBuffer.h" | 13 #include "GrGLIndexBuffer.h" |
14 #include "GrGLPathRendering.h" | 14 #include "GrGLPathRendering.h" |
15 #include "GrGLProgram.h" | 15 #include "GrGLProgram.h" |
16 #include "GrGLRenderTarget.h" | 16 #include "GrGLRenderTarget.h" |
17 #include "GrGLStencilAttachment.h" | 17 #include "GrGLStencilAttachment.h" |
18 #include "GrGLTexture.h" | 18 #include "GrGLTexture.h" |
19 #include "GrGLTransferBuffer.h" | |
20 #include "GrGLVertexArray.h" | 19 #include "GrGLVertexArray.h" |
21 #include "GrGLVertexBuffer.h" | 20 #include "GrGLVertexBuffer.h" |
22 #include "GrGpu.h" | 21 #include "GrGpu.h" |
23 #include "GrPipelineBuilder.h" | 22 #include "GrPipelineBuilder.h" |
24 #include "GrXferProcessor.h" | 23 #include "GrXferProcessor.h" |
25 #include "SkTypes.h" | 24 #include "SkTypes.h" |
26 | 25 |
27 class GrPipeline; | 26 class GrPipeline; |
28 class GrNonInstancedVertices; | 27 class GrNonInstancedVertices; |
29 | 28 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 void buildProgramDesc(GrProgramDesc*, | 94 void buildProgramDesc(GrProgramDesc*, |
96 const GrPrimitiveProcessor&, | 95 const GrPrimitiveProcessor&, |
97 const GrPipeline&) const override; | 96 const GrPipeline&) const override; |
98 | 97 |
99 // id and type (GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER) of buffer to bin
d | 98 // id and type (GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER) of buffer to bin
d |
100 void bindBuffer(GrGLuint id, GrGLenum type); | 99 void bindBuffer(GrGLuint id, GrGLenum type); |
101 | 100 |
102 void releaseBuffer(GrGLuint id, GrGLenum type); | 101 void releaseBuffer(GrGLuint id, GrGLenum type); |
103 | 102 |
104 // sizes are in bytes | 103 // sizes are in bytes |
105 void* mapBuffer(GrGLuint id, GrGLenum type, GrGLBufferImpl::Usage usage, siz
e_t currentSize, | 104 void* mapBuffer(GrGLuint id, GrGLenum type, bool dynamic, size_t currentSize
, |
106 size_t requestedSize); | 105 size_t requestedSize); |
107 | 106 |
108 void unmapBuffer(GrGLuint id, GrGLenum type, void* mapPtr); | 107 void unmapBuffer(GrGLuint id, GrGLenum type, void* mapPtr); |
109 | 108 |
110 void bufferData(GrGLuint id, GrGLenum type, GrGLBufferImpl::Usage usage, siz
e_t currentSize, | 109 void bufferData(GrGLuint id, GrGLenum type, bool dynamic, size_t currentSize
, |
111 const void* src, size_t srcSizeInBytes); | 110 const void* src, size_t srcSizeInBytes); |
112 | 111 |
113 const GrGLContext* glContextForTesting() const override { | 112 const GrGLContext* glContextForTesting() const override { |
114 return &this->glContext(); | 113 return &this->glContext(); |
115 } | 114 } |
116 | 115 |
117 void clearStencil(GrRenderTarget*) override; | 116 void clearStencil(GrRenderTarget*) override; |
118 | 117 |
119 void invalidateBoundRenderTarget() { | 118 void invalidateBoundRenderTarget() { |
120 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; | 119 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; |
(...skipping 16 matching lines...) Expand all Loading... |
137 | 136 |
138 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; | 137 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
139 | 138 |
140 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, | 139 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, |
141 const void* srcData, size_t rowBytes) override; | 140 const void* srcData, size_t rowBytes) override; |
142 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 141 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
143 GrGpuResource::LifeCycle lifeCycle, | 142 GrGpuResource::LifeCycle lifeCycle, |
144 const void* srcData) override; | 143 const void* srcData) override; |
145 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; | 144 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; |
146 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; | 145 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; |
147 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove
rride; | |
148 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; | 146 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; |
149 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, | 147 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, |
150 GrWrapOwnership) override; | 148 GrWrapOwnership) override; |
151 // Given a GrPixelConfig return the index into the stencil format array on G
rGLCaps to a | 149 // Given a GrPixelConfig return the index into the stencil format array on G
rGLCaps to a |
152 // compatible stencil format. | 150 // compatible stencil format. |
153 int getCompatibleStencilIndex(GrPixelConfig config); | 151 int getCompatibleStencilIndex(GrPixelConfig config); |
154 | 152 |
155 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; | 153 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; |
156 | 154 |
157 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli
p) override; | 155 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli
p) override; |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 525 |
528 // Mapping of pixel configs to known supported stencil formats to be used | 526 // Mapping of pixel configs to known supported stencil formats to be used |
529 // when adding a stencil buffer to a framebuffer. | 527 // when adding a stencil buffer to a framebuffer. |
530 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; | 528 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; |
531 | 529 |
532 typedef GrGpu INHERITED; | 530 typedef GrGpu INHERITED; |
533 friend class GrGLPathRendering; // For accessing setTextureUnit. | 531 friend class GrGLPathRendering; // For accessing setTextureUnit. |
534 }; | 532 }; |
535 | 533 |
536 #endif | 534 #endif |
OLD | NEW |