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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 void discard(GrRenderTarget*) override; | 57 void discard(GrRenderTarget*) override; |
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, intptr_t offsetInBytes, GrPixelConfig, GrG
LBuffer*); | 63 void bindTexelBuffer(int unitIdx, intptr_t offsetInBytes, GrPixelConfig, GrG
LBuffer*); |
64 | 64 |
| 65 void generateMipmaps(const GrTextureParams& params, bool allowSRGBInputs, Gr
GLTexture* texture); |
| 66 |
65 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, |
66 GrPixelConfig readConfig, DrawPreference*, | 68 GrPixelConfig readConfig, DrawPreference*, |
67 ReadPixelTempDrawInfo*) override; | 69 ReadPixelTempDrawInfo*) override; |
68 | 70 |
69 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, | 71 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, |
70 GrPixelConfig srcConfig, DrawPreference*, | 72 GrPixelConfig srcConfig, DrawPreference*, |
71 WritePixelTempDrawInfo*) override; | 73 WritePixelTempDrawInfo*) override; |
72 | 74 |
73 bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const
override; | 75 bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const
override; |
74 | 76 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 const SkIRect& srcRect, | 232 const SkIRect& srcRect, |
231 const SkIPoint& dstPoint); | 233 const SkIPoint& dstPoint); |
232 void copySurfaceAsCopyTexSubImage(GrSurface* dst, | 234 void copySurfaceAsCopyTexSubImage(GrSurface* dst, |
233 GrSurface* src, | 235 GrSurface* src, |
234 const SkIRect& srcRect, | 236 const SkIRect& srcRect, |
235 const SkIPoint& dstPoint); | 237 const SkIPoint& dstPoint); |
236 bool copySurfaceAsBlitFramebuffer(GrSurface* dst, | 238 bool copySurfaceAsBlitFramebuffer(GrSurface* dst, |
237 GrSurface* src, | 239 GrSurface* src, |
238 const SkIRect& srcRect, | 240 const SkIRect& srcRect, |
239 const SkIPoint& dstPoint); | 241 const SkIPoint& dstPoint); |
| 242 bool generateMipmap(GrGLTexture* texture, bool gammaCorrect); |
240 | 243 |
241 void stampPLSSetupRect(const SkRect& bounds); | 244 void stampPLSSetupRect(const SkRect& bounds); |
242 | 245 |
243 void setupPixelLocalStorage(const GrPipeline&, const GrPrimitiveProcessor&); | 246 void setupPixelLocalStorage(const GrPipeline&, const GrPrimitiveProcessor&); |
244 | 247 |
245 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); | 248 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); |
246 | 249 |
247 class ProgramCache : public ::SkNoncopyable { | 250 class ProgramCache : public ::SkNoncopyable { |
248 public: | 251 public: |
249 ProgramCache(GrGLGpu* gpu); | 252 ProgramCache(GrGLGpu* gpu); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // Need not be called if flushRenderTarget is used. | 315 // Need not be called if flushRenderTarget is used. |
313 void flushViewport(const GrGLIRect&); | 316 void flushViewport(const GrGLIRect&); |
314 | 317 |
315 void flushStencil(const GrStencilSettings&); | 318 void flushStencil(const GrStencilSettings&); |
316 | 319 |
317 // rt is used only if useHWAA is true. | 320 // rt is used only if useHWAA is true. |
318 void flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool stencilEnabled); | 321 void flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool stencilEnabled); |
319 | 322 |
320 void flushMinSampleShading(float minSampleShading); | 323 void flushMinSampleShading(float minSampleShading); |
321 | 324 |
| 325 void setFramebufferSRGB(bool enable); |
| 326 |
322 // helper for onCreateTexture and writeTexturePixels | 327 // helper for onCreateTexture and writeTexturePixels |
323 enum UploadType { | 328 enum UploadType { |
324 kNewTexture_UploadType, // we are creating a new texture | 329 kNewTexture_UploadType, // we are creating a new texture |
325 kWrite_UploadType, // we are using TexSubImage2D to copy data to
an existing texture | 330 kWrite_UploadType, // we are using TexSubImage2D to copy data to
an existing texture |
326 kTransfer_UploadType, // we are using a transfer buffer to copy dat
a | 331 kTransfer_UploadType, // we are using a transfer buffer to copy dat
a |
327 }; | 332 }; |
328 bool uploadTexData(const GrSurfaceDesc& desc, | 333 bool uploadTexData(const GrSurfaceDesc& desc, |
329 GrGLenum target, | 334 GrGLenum target, |
330 UploadType uploadType, | 335 UploadType uploadType, |
331 int left, int top, int width, int height, | 336 int left, int top, int width, int height, |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 bool fHWPLSEnabled; | 567 bool fHWPLSEnabled; |
563 bool fPLSHasBeenUsed; | 568 bool fPLSHasBeenUsed; |
564 | 569 |
565 float fHWMinSampleShading; | 570 float fHWMinSampleShading; |
566 | 571 |
567 typedef GrGpu INHERITED; | 572 typedef GrGpu INHERITED; |
568 friend class GrGLPathRendering; // For accessing setTextureUnit. | 573 friend class GrGLPathRendering; // For accessing setTextureUnit. |
569 }; | 574 }; |
570 | 575 |
571 #endif | 576 #endif |
OLD | NEW |