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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget* rt, | 122 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa
rget* rt, |
123 int width, | 123 int width, |
124 int height) over
ride; | 124 int height) over
ride; |
125 | 125 |
126 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, | 126 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, |
127 GrPixelConfig config) const
override; | 127 GrPixelConfig config) const
override; |
128 bool isTestingOnlyBackendTexture(GrBackendObject) const override; | 128 bool isTestingOnlyBackendTexture(GrBackendObject) const override; |
129 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c
onst override; | 129 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c
onst override; |
130 | 130 |
| 131 void resetShaderCacheForTesting() const override; |
| 132 |
131 private: | 133 private: |
132 GrGLGpu(GrGLContext* ctx, GrContext* context); | 134 GrGLGpu(GrGLContext* ctx, GrContext* context); |
133 | 135 |
134 // GrGpu overrides | 136 // GrGpu overrides |
135 void onResetContext(uint32_t resetBits) override; | 137 void onResetContext(uint32_t resetBits) override; |
136 | 138 |
137 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; | 139 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
138 | 140 |
139 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, | 141 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, |
140 const void* srcData, size_t rowBytes) override; | 142 const void* srcData, size_t rowBytes) override; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 const SkIRect& srcRect, | 208 const SkIRect& srcRect, |
207 const SkIPoint& dstPoint); | 209 const SkIPoint& dstPoint); |
208 | 210 |
209 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); | 211 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); |
210 | 212 |
211 class ProgramCache : public ::SkNoncopyable { | 213 class ProgramCache : public ::SkNoncopyable { |
212 public: | 214 public: |
213 ProgramCache(GrGLGpu* gpu); | 215 ProgramCache(GrGLGpu* gpu); |
214 ~ProgramCache(); | 216 ~ProgramCache(); |
215 | 217 |
| 218 void reset(); |
216 void abandon(); | 219 void abandon(); |
217 GrGLProgram* refProgram(const DrawArgs&); | 220 GrGLProgram* refProgram(const DrawArgs&); |
218 | 221 |
219 private: | 222 private: |
220 enum { | 223 enum { |
221 // We may actually have kMaxEntries+1 shaders in the GL context beca
use we create a new | 224 // We may actually have kMaxEntries+1 shaders in the GL context beca
use we create a new |
222 // shader before evicting from the cache. | 225 // shader before evicting from the cache. |
223 kMaxEntries = 128, | 226 kMaxEntries = 128, |
224 kHashBits = 6, | 227 kHashBits = 6, |
225 }; | 228 }; |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 528 |
526 // Mapping of pixel configs to known supported stencil formats to be used | 529 // Mapping of pixel configs to known supported stencil formats to be used |
527 // when adding a stencil buffer to a framebuffer. | 530 // when adding a stencil buffer to a framebuffer. |
528 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; | 531 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; |
529 | 532 |
530 typedef GrGpu INHERITED; | 533 typedef GrGpu INHERITED; |
531 friend class GrGLPathRendering; // For accessing setTextureUnit. | 534 friend class GrGLPathRendering; // For accessing setTextureUnit. |
532 }; | 535 }; |
533 | 536 |
534 #endif | 537 #endif |
OLD | NEW |