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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, | 128 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, |
129 GrPixelConfig config) const
override; | 129 GrPixelConfig config) const
override; |
130 bool isTestingOnlyBackendTexture(GrBackendObject) const override; | 130 bool isTestingOnlyBackendTexture(GrBackendObject) const override; |
131 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c
onst override; | 131 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c
onst override; |
132 | 132 |
133 void resetShaderCacheForTesting() const override; | 133 void resetShaderCacheForTesting() const override; |
134 | 134 |
135 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override; | 135 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override; |
136 | 136 |
| 137 void performFlushWorkaround() override; |
| 138 |
137 private: | 139 private: |
138 GrGLGpu(GrGLContext* ctx, GrContext* context); | 140 GrGLGpu(GrGLContext* ctx, GrContext* context); |
139 | 141 |
140 // GrGpu overrides | 142 // GrGpu overrides |
141 void onResetContext(uint32_t resetBits) override; | 143 void onResetContext(uint32_t resetBits) override; |
142 | 144 |
143 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; | 145 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
144 | 146 |
145 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, | 147 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, |
146 const void* srcData, size_t rowBytes) override; | 148 const void* srcData, size_t rowBytes) override; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 const SkIPoint& dstPoint); | 229 const SkIPoint& dstPoint); |
228 void copySurfaceAsCopyTexSubImage(GrSurface* dst, | 230 void copySurfaceAsCopyTexSubImage(GrSurface* dst, |
229 GrSurface* src, | 231 GrSurface* src, |
230 const SkIRect& srcRect, | 232 const SkIRect& srcRect, |
231 const SkIPoint& dstPoint); | 233 const SkIPoint& dstPoint); |
232 bool copySurfaceAsBlitFramebuffer(GrSurface* dst, | 234 bool copySurfaceAsBlitFramebuffer(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 | 238 |
| 239 void stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGLint p
osXformUniform, |
| 240 GrGLuint arrayBuffer); |
| 241 |
| 242 void setupPixelLocalStorage(const DrawArgs& args); |
| 243 |
237 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); | 244 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); |
238 | 245 |
239 class ProgramCache : public ::SkNoncopyable { | 246 class ProgramCache : public ::SkNoncopyable { |
240 public: | 247 public: |
241 ProgramCache(GrGLGpu* gpu); | 248 ProgramCache(GrGLGpu* gpu); |
242 ~ProgramCache(); | 249 ~ProgramCache(); |
243 | 250 |
244 void reset(); | 251 void reset(); |
245 void abandon(); | 252 void abandon(); |
246 GrGLProgram* refProgram(const DrawArgs&); | 253 GrGLProgram* refProgram(const DrawArgs&); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 355 |
349 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co
pying. | 356 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co
pying. |
350 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); | 357 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); |
351 | 358 |
352 SkAutoTUnref<GrGLContext> fGLContext; | 359 SkAutoTUnref<GrGLContext> fGLContext; |
353 | 360 |
354 void createCopyPrograms(); | 361 void createCopyPrograms(); |
355 void createWireRectProgram(); | 362 void createWireRectProgram(); |
356 void createUnitRectBuffer(); | 363 void createUnitRectBuffer(); |
357 | 364 |
| 365 void createPLSSetupProgram(); |
| 366 |
358 // GL program-related state | 367 // GL program-related state |
359 ProgramCache* fProgramCache; | 368 ProgramCache* fProgramCache; |
360 | 369 |
361 /////////////////////////////////////////////////////////////////////////// | 370 /////////////////////////////////////////////////////////////////////////// |
362 ///@name Caching of GL State | 371 ///@name Caching of GL State |
363 ///@{ | 372 ///@{ |
364 int fHWActiveTextureUnitIdx; | 373 int fHWActiveTextureUnitIdx; |
365 GrGLuint fHWProgramID; | 374 GrGLuint fHWProgramID; |
366 | 375 |
367 enum TriState { | 376 enum TriState { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 case GR_GL_TEXTURE_EXTERNAL: | 567 case GR_GL_TEXTURE_EXTERNAL: |
559 return 1; | 568 return 1; |
560 case GR_GL_TEXTURE_RECTANGLE: | 569 case GR_GL_TEXTURE_RECTANGLE: |
561 return 2; | 570 return 2; |
562 default: | 571 default: |
563 SkFAIL("Unexpected texture target type."); | 572 SkFAIL("Unexpected texture target type."); |
564 return 0; | 573 return 0; |
565 } | 574 } |
566 } | 575 } |
567 | 576 |
| 577 struct { |
| 578 GrGLuint fProgram; |
| 579 GrGLint fPosXformUniform; |
| 580 GrGLuint fArrayBuffer; |
| 581 } fPLSSetupProgram; |
| 582 |
| 583 bool fHWPLSEnabled; |
| 584 bool fPLSHasBeenUsed; |
| 585 |
568 typedef GrGpu INHERITED; | 586 typedef GrGpu INHERITED; |
569 friend class GrGLPathRendering; // For accessing setTextureUnit. | 587 friend class GrGLPathRendering; // For accessing setTextureUnit. |
570 }; | 588 }; |
571 | 589 |
572 #endif | 590 #endif |
OLD | NEW |