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 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 GrGLStandard glStandard() const { return fGLContext->standard(); } | 47 GrGLStandard glStandard() const { return fGLContext->standard(); } |
48 GrGLVersion glVersion() const { return fGLContext->version(); } | 48 GrGLVersion glVersion() const { return fGLContext->version(); } |
49 GrGLSLGeneration glslGeneration() const { return fGLContext->glslGeneration( ); } | 49 GrGLSLGeneration glslGeneration() const { return fGLContext->glslGeneration( ); } |
50 const GrGLCaps& glCaps() const { return *fGLContext->caps(); } | 50 const GrGLCaps& glCaps() const { return *fGLContext->caps(); } |
51 | 51 |
52 GrGLPathRendering* glPathRendering() { | 52 GrGLPathRendering* glPathRendering() { |
53 SkASSERT(glCaps().shaderCaps()->pathRenderingSupport()); | 53 SkASSERT(glCaps().shaderCaps()->pathRenderingSupport()); |
54 return static_cast<GrGLPathRendering*>(pathRendering()); | 54 return static_cast<GrGLPathRendering*>(pathRendering()); |
55 } | 55 } |
56 | 56 |
57 void discard(GrRenderTarget*) override; | 57 void discard(GrRenderTarget*); |
58 | 58 |
59 // Used by GrGLProgram to configure OpenGL state. | 59 // Used by GrGLProgram to configure OpenGL state. |
60 void bindTexture(int unitIdx, const GrTextureParams& params, bool allowSRGBI nputs, | 60 void bindTexture(int unitIdx, const GrTextureParams& params, bool allowSRGBI nputs, |
61 GrGLTexture* texture); | 61 GrGLTexture* texture); |
62 | 62 |
63 void bindTexelBuffer(int unitIdx, GrPixelConfig, GrGLBuffer*); | 63 void bindTexelBuffer(int unitIdx, GrPixelConfig, GrGLBuffer*); |
64 | 64 |
65 void generateMipmaps(const GrTextureParams& params, bool allowSRGBInputs, Gr GLTexture* texture); | 65 void generateMipmaps(const GrTextureParams& params, bool allowSRGBInputs, Gr GLTexture* texture); |
66 | 66 |
67 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh t, size_t rowBytes, | 67 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh t, size_t rowBytes, |
(...skipping 20 matching lines...) Expand all Loading... | |
88 | 88 |
89 // Binds a buffer to the GL target corresponding to 'type', updates internal state tracking, and | 89 // Binds a buffer to the GL target corresponding to 'type', updates internal state tracking, and |
90 // returns the GL target the buffer was bound to. | 90 // returns the GL target the buffer was bound to. |
91 // When 'type' is kIndex_GrBufferType, this function will also implicitly bi nd the default VAO. | 91 // When 'type' is kIndex_GrBufferType, this function will also implicitly bi nd the default VAO. |
92 // If the caller wishes to bind an index buffer to a specific VAO, it can ca ll glBind directly. | 92 // If the caller wishes to bind an index buffer to a specific VAO, it can ca ll glBind directly. |
93 GrGLenum bindBuffer(GrBufferType type, const GrGLBuffer*); | 93 GrGLenum bindBuffer(GrBufferType type, const GrGLBuffer*); |
94 | 94 |
95 // Called by GrGLBuffer after its buffer object has been destroyed. | 95 // Called by GrGLBuffer after its buffer object has been destroyed. |
96 void notifyBufferReleased(const GrGLBuffer*); | 96 void notifyBufferReleased(const GrGLBuffer*); |
97 | 97 |
98 void draw(const GrPipeline&, | |
bsalomon
2016/06/20 16:51:14
Maybe a comment on these that they are the passthr
egdaniel
2016/06/22 15:26:57
Done.
| |
99 const GrPrimitiveProcessor&, | |
100 const GrMesh*, | |
101 int meshCount); | |
102 | |
103 /** | |
104 * Clear the passed in render target. Ignores the draw state and clip. | |
105 */ | |
106 void clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget) ; | |
107 | |
108 void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* renderTarget); | |
109 | |
98 const GrGLContext* glContextForTesting() const override { | 110 const GrGLContext* glContextForTesting() const override { |
99 return &this->glContext(); | 111 return &this->glContext(); |
100 } | 112 } |
101 | 113 |
102 void clearStencil(GrRenderTarget*) override; | 114 void clearStencil(GrRenderTarget*) override; |
103 | 115 |
104 GrGpuCommandBuffer* createCommandBuffer(const GrRenderTarget& target, | 116 GrGpuCommandBuffer* createCommandBuffer(GrRenderTarget* target, |
105 GrGpuCommandBuffer::LoadAndStoreOp c olorOp, | 117 GrGpuCommandBuffer::LoadAndStoreOp c olorOp, |
106 GrColor colorClear, | 118 GrColor colorClear, |
107 GrGpuCommandBuffer::LoadAndStoreOp s tencilOp, | 119 GrGpuCommandBuffer::LoadAndStoreOp s tencilOp, |
108 GrColor stencilClear) override; | 120 GrColor stencilClear) override; |
109 | 121 |
110 void invalidateBoundRenderTarget() { | 122 void invalidateBoundRenderTarget() { |
111 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; | 123 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; |
112 } | 124 } |
113 | 125 |
114 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa rget* rt, | 126 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa rget* rt, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 | 164 |
153 | 165 |
154 // Returns whether the texture is successfully created. On success, the | 166 // Returns whether the texture is successfully created. On success, the |
155 // result is stored in |info|. | 167 // result is stored in |info|. |
156 // The texture is populated with |texels|, if it exists. | 168 // The texture is populated with |texels|, if it exists. |
157 // The texture parameters are cached in |initialTexParams|. | 169 // The texture parameters are cached in |initialTexParams|. |
158 bool createTextureImpl(const GrSurfaceDesc& desc, GrGLTextureInfo* info, | 170 bool createTextureImpl(const GrSurfaceDesc& desc, GrGLTextureInfo* info, |
159 bool renderTarget, GrGLTexture::TexParams* initialTex Params, | 171 bool renderTarget, GrGLTexture::TexParams* initialTex Params, |
160 const SkTArray<GrMipLevel>& texels); | 172 const SkTArray<GrMipLevel>& texels); |
161 | 173 |
162 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; | |
163 | |
164 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override; | |
165 | |
166 bool onMakeCopyForTextureParams(GrTexture*, const GrTextureParams&, | 174 bool onMakeCopyForTextureParams(GrTexture*, const GrTextureParams&, |
167 GrTextureProducer::CopyParams*) const overri de; | 175 GrTextureProducer::CopyParams*) const overri de; |
168 | 176 |
169 // Checks whether glReadPixels can be called to get pixel values in readConf ig from the | 177 // Checks whether glReadPixels can be called to get pixel values in readConf ig from the |
170 // render target. | 178 // render target. |
171 bool readPixelsSupported(GrRenderTarget* target, GrPixelConfig readConfig); | 179 bool readPixelsSupported(GrRenderTarget* target, GrPixelConfig readConfig); |
172 | 180 |
173 // Checks whether glReadPixels can be called to get pixel values in readConf ig from a | 181 // Checks whether glReadPixels can be called to get pixel values in readConf ig from a |
174 // render target that has renderTargetConfig. This may have to create a temp orary | 182 // render target that has renderTargetConfig. This may have to create a temp orary |
175 // render target and thus is less preferable than the variant that takes a r ender target. | 183 // render target and thus is less preferable than the variant that takes a r ender target. |
(...skipping 16 matching lines...) Expand all Loading... | |
192 GrPixelConfig config, | 200 GrPixelConfig config, |
193 const SkTArray<GrMipLevel>& texels) override; | 201 const SkTArray<GrMipLevel>& texels) override; |
194 | 202 |
195 bool onTransferPixels(GrSurface*, | 203 bool onTransferPixels(GrSurface*, |
196 int left, int top, int width, int height, | 204 int left, int top, int width, int height, |
197 GrPixelConfig config, GrBuffer* transferBuffer, | 205 GrPixelConfig config, GrBuffer* transferBuffer, |
198 size_t offset, size_t rowBytes) override; | 206 size_t offset, size_t rowBytes) override; |
199 | 207 |
200 void onResolveRenderTarget(GrRenderTarget* target) override; | 208 void onResolveRenderTarget(GrRenderTarget* target) override; |
201 | 209 |
202 void onDraw(const GrPipeline&, | |
203 const GrPrimitiveProcessor&, | |
204 const GrMesh*, | |
205 int meshCount) override; | |
206 | |
207 bool onCopySurface(GrSurface* dst, | 210 bool onCopySurface(GrSurface* dst, |
208 GrSurface* src, | 211 GrSurface* src, |
209 const SkIRect& srcRect, | 212 const SkIRect& srcRect, |
210 const SkIPoint& dstPoint) override; | 213 const SkIPoint& dstPoint) override; |
211 | 214 |
212 void onGetMultisampleSpecs(GrRenderTarget*, | 215 void onGetMultisampleSpecs(GrRenderTarget*, |
213 const GrStencilSettings&, | 216 const GrStencilSettings&, |
214 int* effectiveSampleCnt, | 217 int* effectiveSampleCnt, |
215 SkAutoTDeleteArray<SkPoint>* sampleLocations) ove rride; | 218 SkAutoTDeleteArray<SkPoint>* sampleLocations) ove rride; |
216 | 219 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
586 bool fHWPLSEnabled; | 589 bool fHWPLSEnabled; |
587 bool fPLSHasBeenUsed; | 590 bool fPLSHasBeenUsed; |
588 | 591 |
589 float fHWMinSampleShading; | 592 float fHWMinSampleShading; |
590 | 593 |
591 typedef GrGpu INHERITED; | 594 typedef GrGpu INHERITED; |
592 friend class GrGLPathRendering; // For accessing setTextureUnit. | 595 friend class GrGLPathRendering; // For accessing setTextureUnit. |
593 }; | 596 }; |
594 | 597 |
595 #endif | 598 #endif |
OLD | NEW |