| 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 GrGpuGL_DEFINED | 8 #ifndef GrGpuGL_DEFINED |
| 9 #define GrGpuGL_DEFINED | 9 #define GrGpuGL_DEFINED |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #ifdef SK_DEVELOPER | 25 #ifdef SK_DEVELOPER |
| 26 #define PROGRAM_CACHE_STATS | 26 #define PROGRAM_CACHE_STATS |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 class GrGpuGL : public GrGpu { | 29 class GrGpuGL : public GrGpu { |
| 30 public: | 30 public: |
| 31 GrGpuGL(const GrGLContext& ctx, GrContext* context); | 31 GrGpuGL(const GrGLContext& ctx, GrContext* context); |
| 32 virtual ~GrGpuGL(); | 32 virtual ~GrGpuGL(); |
| 33 | 33 |
| 34 const GrGLContext& glContext() const { return fGLContext; } |
| 35 |
| 34 const GrGLInterface* glInterface() const { return fGLContext.interface(); } | 36 const GrGLInterface* glInterface() const { return fGLContext.interface(); } |
| 35 const GrGLContextInfo& ctxInfo() const { return fGLContext.info(); } | 37 const GrGLContextInfo& ctxInfo() const { return fGLContext.info(); } |
| 36 GrGLBinding glBinding() const { return fGLContext.info().binding(); } | 38 GrGLBinding glBinding() const { return fGLContext.info().binding(); } |
| 37 GrGLVersion glVersion() const { return fGLContext.info().version(); } | 39 GrGLVersion glVersion() const { return fGLContext.info().version(); } |
| 38 GrGLSLGeneration glslGeneration() const { return fGLContext.info().glslGener
ation(); } | 40 GrGLSLGeneration glslGeneration() const { return fGLContext.info().glslGener
ation(); } |
| 39 | 41 |
| 40 // Used by GrGLProgram and GrGLTexGenProgramEffects to configure OpenGL stat
e. | 42 // Used by GrGLProgram and GrGLTexGenProgramEffects to configure OpenGL stat
e. |
| 41 void bindTexture(int unitIdx, const GrTextureParams& params, GrGLTexture* te
xture); | 43 void bindTexture(int unitIdx, const GrTextureParams& params, GrGLTexture* te
xture); |
| 42 void setProjectionMatrix(const SkMatrix& matrix, | 44 void setProjectionMatrix(const SkMatrix& matrix, |
| 43 const SkISize& renderTargetSize, | 45 const SkISize& renderTargetSize, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 void setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes); | 172 void setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes); |
| 171 | 173 |
| 172 // Subclasses should call this to flush the blend state. | 174 // Subclasses should call this to flush the blend state. |
| 173 // The params should be the final coefficients to apply | 175 // The params should be the final coefficients to apply |
| 174 // (after any blending optimizations or dual source blending considerations | 176 // (after any blending optimizations or dual source blending considerations |
| 175 // have been accounted for). | 177 // have been accounted for). |
| 176 void flushBlend(bool isLines, GrBlendCoeff srcCoeff, GrBlendCoeff dstCoeff); | 178 void flushBlend(bool isLines, GrBlendCoeff srcCoeff, GrBlendCoeff dstCoeff); |
| 177 | 179 |
| 178 bool hasExtension(const char* ext) const { return fGLContext.info().hasExten
sion(ext); } | 180 bool hasExtension(const char* ext) const { return fGLContext.info().hasExten
sion(ext); } |
| 179 | 181 |
| 180 const GrGLContext& glContext() const { return fGLContext; } | |
| 181 | |
| 182 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); | 182 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); |
| 183 | 183 |
| 184 class ProgramCache : public ::SkNoncopyable { | 184 class ProgramCache : public ::SkNoncopyable { |
| 185 public: | 185 public: |
| 186 ProgramCache(GrGpuGL* gpu); | 186 ProgramCache(GrGpuGL* gpu); |
| 187 ~ProgramCache(); | 187 ~ProgramCache(); |
| 188 | 188 |
| 189 void abandon(); | 189 void abandon(); |
| 190 GrGLProgram* getProgram(const GrGLProgramDesc& desc, | 190 GrGLProgram* getProgram(const GrGLProgramDesc& desc, |
| 191 const GrEffectStage* colorStages[], | 191 const GrEffectStage* colorStages[], |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 ///@} | 450 ///@} |
| 451 | 451 |
| 452 // we record what stencil format worked last time to hopefully exit early | 452 // we record what stencil format worked last time to hopefully exit early |
| 453 // from our loop that tries stencil formats and calls check fb status. | 453 // from our loop that tries stencil formats and calls check fb status. |
| 454 int fLastSuccessfulStencilFmtIdx; | 454 int fLastSuccessfulStencilFmtIdx; |
| 455 | 455 |
| 456 typedef GrGpu INHERITED; | 456 typedef GrGpu INHERITED; |
| 457 }; | 457 }; |
| 458 | 458 |
| 459 #endif | 459 #endif |
| OLD | NEW |