Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: src/gpu/gl/GrGLGpu.h

Issue 2078483002: Start using GrGpuCommandBuffer in GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@memoryWAR
Patch Set: remove errant lines Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/batches/GrVertexBatch.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 // The GrGLGpuCommandBuffer does not buffer up draws before submitting them to the gpu.
99 // Thus this is the implementation of the draw call for the corresponding pa ssthrough function
100 // on GrGLGpuCommandBuffer.
101 void draw(const GrPipeline&,
102 const GrPrimitiveProcessor&,
103 const GrMesh*,
104 int meshCount);
105
106 // The GrGLGpuCommandBuffer does not buffer up draws before submitting them to the gpu.
107 // Thus this is the implementation of the clear call for the corresponding p assthrough function
108 // on GrGLGpuCommandBuffer.
109 void clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget) ;
110
111 // The GrGLGpuCommandBuffer does not buffer up draws before submitting them to the gpu.
112 // Thus this is the implementation of the clearStencil call for the correspo nding passthrough
113 // function on GrGLGpuCommandBuffer.
114 void clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTarget* renderTarget);
115
98 const GrGLContext* glContextForTesting() const override { 116 const GrGLContext* glContextForTesting() const override {
99 return &this->glContext(); 117 return &this->glContext();
100 } 118 }
101 119
102 void clearStencil(GrRenderTarget*) override; 120 void clearStencil(GrRenderTarget*) override;
103 121
104 GrGpuCommandBuffer* createCommandBuffer(const GrRenderTarget& target, 122 GrGpuCommandBuffer* createCommandBuffer(
105 GrGpuCommandBuffer::LoadAndStoreOp c olorOp, 123 GrRenderTarget* target,
106 GrColor colorClear, 124 const GrGpuCommandBuffer::LoadAndStoreInfo& colorInfo,
107 GrGpuCommandBuffer::LoadAndStoreOp s tencilOp, 125 const GrGpuCommandBuffer::LoadAndStoreInfo& stencilInfo) override;
108 GrColor stencilClear) override;
109 126
110 void invalidateBoundRenderTarget() { 127 void invalidateBoundRenderTarget() {
111 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; 128 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID;
112 } 129 }
113 130
114 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa rget* rt, 131 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa rget* rt,
115 int width, 132 int width,
116 int height) over ride; 133 int height) over ride;
117 134
118 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, 135 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 169
153 170
154 // Returns whether the texture is successfully created. On success, the 171 // Returns whether the texture is successfully created. On success, the
155 // result is stored in |info|. 172 // result is stored in |info|.
156 // The texture is populated with |texels|, if it exists. 173 // The texture is populated with |texels|, if it exists.
157 // The texture parameters are cached in |initialTexParams|. 174 // The texture parameters are cached in |initialTexParams|.
158 bool createTextureImpl(const GrSurfaceDesc& desc, GrGLTextureInfo* info, 175 bool createTextureImpl(const GrSurfaceDesc& desc, GrGLTextureInfo* info,
159 bool renderTarget, GrGLTexture::TexParams* initialTex Params, 176 bool renderTarget, GrGLTexture::TexParams* initialTex Params,
160 const SkTArray<GrMipLevel>& texels); 177 const SkTArray<GrMipLevel>& texels);
161 178
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&, 179 bool onMakeCopyForTextureParams(GrTexture*, const GrTextureParams&,
167 GrTextureProducer::CopyParams*) const overri de; 180 GrTextureProducer::CopyParams*) const overri de;
168 181
169 // Checks whether glReadPixels can be called to get pixel values in readConf ig from the 182 // Checks whether glReadPixels can be called to get pixel values in readConf ig from the
170 // render target. 183 // render target.
171 bool readPixelsSupported(GrRenderTarget* target, GrPixelConfig readConfig); 184 bool readPixelsSupported(GrRenderTarget* target, GrPixelConfig readConfig);
172 185
173 // Checks whether glReadPixels can be called to get pixel values in readConf ig from a 186 // 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 187 // 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. 188 // render target and thus is less preferable than the variant that takes a r ender target.
(...skipping 16 matching lines...) Expand all
192 GrPixelConfig config, 205 GrPixelConfig config,
193 const SkTArray<GrMipLevel>& texels) override; 206 const SkTArray<GrMipLevel>& texels) override;
194 207
195 bool onTransferPixels(GrSurface*, 208 bool onTransferPixels(GrSurface*,
196 int left, int top, int width, int height, 209 int left, int top, int width, int height,
197 GrPixelConfig config, GrBuffer* transferBuffer, 210 GrPixelConfig config, GrBuffer* transferBuffer,
198 size_t offset, size_t rowBytes) override; 211 size_t offset, size_t rowBytes) override;
199 212
200 void onResolveRenderTarget(GrRenderTarget* target) override; 213 void onResolveRenderTarget(GrRenderTarget* target) override;
201 214
202 void onDraw(const GrPipeline&,
203 const GrPrimitiveProcessor&,
204 const GrMesh*,
205 int meshCount) override;
206
207 bool onCopySurface(GrSurface* dst, 215 bool onCopySurface(GrSurface* dst,
208 GrSurface* src, 216 GrSurface* src,
209 const SkIRect& srcRect, 217 const SkIRect& srcRect,
210 const SkIPoint& dstPoint) override; 218 const SkIPoint& dstPoint) override;
211 219
212 void onGetMultisampleSpecs(GrRenderTarget*, 220 void onGetMultisampleSpecs(GrRenderTarget*,
213 const GrStencilSettings&, 221 const GrStencilSettings&,
214 int* effectiveSampleCnt, 222 int* effectiveSampleCnt,
215 SkAutoTDeleteArray<SkPoint>* sampleLocations) ove rride; 223 SkAutoTDeleteArray<SkPoint>* sampleLocations) ove rride;
216 224
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 bool fHWPLSEnabled; 594 bool fHWPLSEnabled;
587 bool fPLSHasBeenUsed; 595 bool fPLSHasBeenUsed;
588 596
589 float fHWMinSampleShading; 597 float fHWMinSampleShading;
590 598
591 typedef GrGpu INHERITED; 599 typedef GrGpu INHERITED;
592 friend class GrGLPathRendering; // For accessing setTextureUnit. 600 friend class GrGLPathRendering; // For accessing setTextureUnit.
593 }; 601 };
594 602
595 #endif 603 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrVertexBatch.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698