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 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 const SkIPoint& dstPoint); | 212 const SkIPoint& dstPoint); |
| 211 void copySurfaceAsCopyTexSubImage(GrSurface* dst, | 213 void copySurfaceAsCopyTexSubImage(GrSurface* dst, |
| 212 GrSurface* src, | 214 GrSurface* src, |
| 213 const SkIRect& srcRect, | 215 const SkIRect& srcRect, |
| 214 const SkIPoint& dstPoint); | 216 const SkIPoint& dstPoint); |
| 215 bool copySurfaceAsBlitFramebuffer(GrSurface* dst, | 217 bool copySurfaceAsBlitFramebuffer(GrSurface* dst, |
| 216 GrSurface* src, | 218 GrSurface* src, |
| 217 const SkIRect& srcRect, | 219 const SkIRect& srcRect, |
| 218 const SkIPoint& dstPoint); | 220 const SkIPoint& dstPoint); |
| 219 | 221 |
| 222 void stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGLint p osXformUniform, | |
| 223 GrGLuint arrayBuffer); | |
| 224 | |
| 225 void setupPixelLocalStorage(const DrawArgs& args); | |
| 226 | |
| 220 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); | 227 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); |
| 221 | 228 |
| 222 class ProgramCache : public ::SkNoncopyable { | 229 class ProgramCache : public ::SkNoncopyable { |
| 223 public: | 230 public: |
| 224 ProgramCache(GrGLGpu* gpu); | 231 ProgramCache(GrGLGpu* gpu); |
| 225 ~ProgramCache(); | 232 ~ProgramCache(); |
| 226 | 233 |
| 227 void reset(); | 234 void reset(); |
| 228 void abandon(); | 235 void abandon(); |
| 229 GrGLProgram* refProgram(const DrawArgs&); | 236 GrGLProgram* refProgram(const DrawArgs&); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 | 338 |
| 332 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co pying. | 339 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co pying. |
| 333 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); | 340 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); |
| 334 | 341 |
| 335 SkAutoTUnref<GrGLContext> fGLContext; | 342 SkAutoTUnref<GrGLContext> fGLContext; |
| 336 | 343 |
| 337 void createCopyPrograms(); | 344 void createCopyPrograms(); |
| 338 void createWireRectProgram(); | 345 void createWireRectProgram(); |
| 339 void createUnitRectBuffer(); | 346 void createUnitRectBuffer(); |
| 340 | 347 |
| 348 void createPLSSetupProgram(); | |
| 349 | |
| 341 // GL program-related state | 350 // GL program-related state |
| 342 ProgramCache* fProgramCache; | 351 ProgramCache* fProgramCache; |
| 343 | 352 |
| 344 /////////////////////////////////////////////////////////////////////////// | 353 /////////////////////////////////////////////////////////////////////////// |
| 345 ///@name Caching of GL State | 354 ///@name Caching of GL State |
| 346 ///@{ | 355 ///@{ |
| 347 int fHWActiveTextureUnitIdx; | 356 int fHWActiveTextureUnitIdx; |
| 348 GrGLuint fHWProgramID; | 357 GrGLuint fHWProgramID; |
| 349 | 358 |
| 350 enum TriState { | 359 enum TriState { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 | 545 |
| 537 static int TextureTargetToCopyProgramIdx(GrGLenum target) { | 546 static int TextureTargetToCopyProgramIdx(GrGLenum target) { |
| 538 if (target == GR_GL_TEXTURE_2D) { | 547 if (target == GR_GL_TEXTURE_2D) { |
| 539 return 0; | 548 return 0; |
| 540 } else { | 549 } else { |
| 541 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); | 550 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); |
| 542 return 1; | 551 return 1; |
| 543 } | 552 } |
| 544 } | 553 } |
| 545 | 554 |
| 555 #ifdef ENABLE_PLS | |
|
bsalomon
2016/01/13 19:15:34
untab
| |
| 556 struct { | |
| 557 GrGLuint fProgram; | |
| 558 GrGLint fPosXformUniform; | |
| 559 GrGLuint fArrayBuffer; | |
| 560 } fPLSSetupProgram; | |
| 561 | |
| 562 bool fHWPLSEnabled; | |
| 563 #endif | |
| 564 | |
| 546 typedef GrGpu INHERITED; | 565 typedef GrGpu INHERITED; |
| 547 friend class GrGLPathRendering; // For accessing setTextureUnit. | 566 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 548 }; | 567 }; |
| 549 | 568 |
| 550 #endif | 569 #endif |
| OLD | NEW |