Chromium Code Reviews| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 | 126 |
| 127 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, | 127 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, |
| 128 GrPixelConfig config) const override; | 128 GrPixelConfig config) const override; |
| 129 bool isTestingOnlyBackendTexture(GrBackendObject) const override; | 129 bool isTestingOnlyBackendTexture(GrBackendObject) const override; |
| 130 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c onst override; | 130 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c onst override; |
| 131 | 131 |
| 132 void resetShaderCacheForTesting() const override; | 132 void resetShaderCacheForTesting() const override; |
| 133 | 133 |
| 134 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override; | 134 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override; |
| 135 | 135 |
| 136 void performFlushWorkaround() override; | |
| 137 | |
| 136 private: | 138 private: |
| 137 GrGLGpu(GrGLContext* ctx, GrContext* context); | 139 GrGLGpu(GrGLContext* ctx, GrContext* context); |
| 138 | 140 |
| 139 // GrGpu overrides | 141 // GrGpu overrides |
| 140 void onResetContext(uint32_t resetBits) override; | 142 void onResetContext(uint32_t resetBits) override; |
| 141 | 143 |
| 142 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; | 144 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
| 143 | 145 |
| 144 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle, | 146 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle, |
| 145 const void* srcData, size_t rowBytes) override; | 147 const void* srcData, size_t rowBytes) override; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 const SkIPoint& dstPoint); | 207 const SkIPoint& dstPoint); |
| 206 void copySurfaceAsCopyTexSubImage(GrSurface* dst, | 208 void copySurfaceAsCopyTexSubImage(GrSurface* dst, |
| 207 GrSurface* src, | 209 GrSurface* src, |
| 208 const SkIRect& srcRect, | 210 const SkIRect& srcRect, |
| 209 const SkIPoint& dstPoint); | 211 const SkIPoint& dstPoint); |
| 210 bool copySurfaceAsBlitFramebuffer(GrSurface* dst, | 212 bool copySurfaceAsBlitFramebuffer(GrSurface* dst, |
| 211 GrSurface* src, | 213 GrSurface* src, |
| 212 const SkIRect& srcRect, | 214 const SkIRect& srcRect, |
| 213 const SkIPoint& dstPoint); | 215 const SkIPoint& dstPoint); |
| 214 | 216 |
| 217 void stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGLint p osXformUniform, | |
| 218 GrGLuint arrayBuffer); | |
| 219 | |
| 220 void setupPixelLocalStorage(const DrawArgs& args); | |
| 221 | |
| 215 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); | 222 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); |
| 216 | 223 |
| 217 class ProgramCache : public ::SkNoncopyable { | 224 class ProgramCache : public ::SkNoncopyable { |
| 218 public: | 225 public: |
| 219 ProgramCache(GrGLGpu* gpu); | 226 ProgramCache(GrGLGpu* gpu); |
| 220 ~ProgramCache(); | 227 ~ProgramCache(); |
| 221 | 228 |
| 222 void reset(); | 229 void reset(); |
| 223 void abandon(); | 230 void abandon(); |
| 224 GrGLProgram* refProgram(const DrawArgs&); | 231 GrGLProgram* refProgram(const DrawArgs&); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 | 328 |
| 322 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co pying. | 329 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co pying. |
| 323 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); | 330 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); |
| 324 | 331 |
| 325 SkAutoTUnref<GrGLContext> fGLContext; | 332 SkAutoTUnref<GrGLContext> fGLContext; |
| 326 | 333 |
| 327 void createCopyPrograms(); | 334 void createCopyPrograms(); |
| 328 void createWireRectProgram(); | 335 void createWireRectProgram(); |
| 329 void createUnitRectBuffer(); | 336 void createUnitRectBuffer(); |
| 330 | 337 |
| 338 void createPLSSetupProgram(); | |
| 339 | |
| 331 // GL program-related state | 340 // GL program-related state |
| 332 ProgramCache* fProgramCache; | 341 ProgramCache* fProgramCache; |
| 333 | 342 |
| 334 /////////////////////////////////////////////////////////////////////////// | 343 /////////////////////////////////////////////////////////////////////////// |
| 335 ///@name Caching of GL State | 344 ///@name Caching of GL State |
| 336 ///@{ | 345 ///@{ |
| 337 int fHWActiveTextureUnitIdx; | 346 int fHWActiveTextureUnitIdx; |
| 338 GrGLuint fHWProgramID; | 347 GrGLuint fHWProgramID; |
| 339 | 348 |
| 340 enum TriState { | 349 enum TriState { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 526 | 535 |
| 527 static int TextureTargetToCopyProgramIdx(GrGLenum target) { | 536 static int TextureTargetToCopyProgramIdx(GrGLenum target) { |
| 528 if (target == GR_GL_TEXTURE_2D) { | 537 if (target == GR_GL_TEXTURE_2D) { |
| 529 return 0; | 538 return 0; |
| 530 } else { | 539 } else { |
| 531 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); | 540 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); |
| 532 return 1; | 541 return 1; |
| 533 } | 542 } |
| 534 } | 543 } |
| 535 | 544 |
| 545 #ifdef ENABLE_PLS | |
| 546 struct { | |
| 547 GrGLuint fProgram; | |
| 548 GrGLint fPosXformUniform; | |
| 549 GrGLuint fArrayBuffer; | |
| 550 } fPLSSetupProgram; | |
| 551 | |
| 552 bool fHWPLSEnabled; | |
|
bsalomon
2016/01/04 15:33:47
Any possibility this is in an unknown state, say a
| |
| 553 #endif | |
| 554 | |
| 536 typedef GrGpu INHERITED; | 555 typedef GrGpu INHERITED; |
| 537 friend class GrGLPathRendering; // For accessing setTextureUnit. | 556 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 538 }; | 557 }; |
| 539 | 558 |
| 540 #endif | 559 #endif |
| OLD | NEW |