| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; | 131 void resetShaderCacheForTesting() const override; |
| 132 | 132 |
| 133 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override; | |
| 134 | |
| 135 private: | 133 private: |
| 136 GrGLGpu(GrGLContext* ctx, GrContext* context); | 134 GrGLGpu(GrGLContext* ctx, GrContext* context); |
| 137 | 135 |
| 138 // GrGpu overrides | 136 // GrGpu overrides |
| 139 void onResetContext(uint32_t resetBits) override; | 137 void onResetContext(uint32_t resetBits) override; |
| 140 | 138 |
| 141 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; | 139 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
| 142 | 140 |
| 143 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, | 141 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, |
| 144 const void* srcData, size_t rowBytes) override; | 142 const void* srcData, size_t rowBytes) override; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 // This must be paired with a call to unbindSurfaceFBOForCopy(). | 319 // This must be paired with a call to unbindSurfaceFBOForCopy(). |
| 322 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, | 320 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, |
| 323 TempFBOTarget tempFBOTarget); | 321 TempFBOTarget tempFBOTarget); |
| 324 | 322 |
| 325 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co
pying. | 323 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co
pying. |
| 326 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); | 324 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); |
| 327 | 325 |
| 328 SkAutoTUnref<GrGLContext> fGLContext; | 326 SkAutoTUnref<GrGLContext> fGLContext; |
| 329 | 327 |
| 330 void createCopyPrograms(); | 328 void createCopyPrograms(); |
| 331 void createWireRectProgram(); | |
| 332 void createUnitRectBuffer(); | |
| 333 | 329 |
| 334 // GL program-related state | 330 // GL program-related state |
| 335 ProgramCache* fProgramCache; | 331 ProgramCache* fProgramCache; |
| 336 | 332 |
| 337 /////////////////////////////////////////////////////////////////////////// | 333 /////////////////////////////////////////////////////////////////////////// |
| 338 ///@name Caching of GL State | 334 ///@name Caching of GL State |
| 339 ///@{ | 335 ///@{ |
| 340 int fHWActiveTextureUnitIdx; | 336 int fHWActiveTextureUnitIdx; |
| 341 GrGLuint fHWProgramID; | 337 GrGLuint fHWProgramID; |
| 342 | 338 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 | 496 |
| 501 /** IDs for copy surface program. */ | 497 /** IDs for copy surface program. */ |
| 502 struct { | 498 struct { |
| 503 GrGLuint fProgram; | 499 GrGLuint fProgram; |
| 504 GrGLint fTextureUniform; | 500 GrGLint fTextureUniform; |
| 505 GrGLint fTexCoordXformUniform; | 501 GrGLint fTexCoordXformUniform; |
| 506 GrGLint fPosXformUniform; | 502 GrGLint fPosXformUniform; |
| 507 } fCopyPrograms[2]; | 503 } fCopyPrograms[2]; |
| 508 GrGLuint fCopyProgramArrayBuffer; | 504 GrGLuint fCopyProgramArrayBuffer; |
| 509 | 505 |
| 510 struct { | |
| 511 GrGLuint fProgram; | |
| 512 GrGLint fColorUniform; | |
| 513 GrGLint fRectUniform; | |
| 514 } fWireRectProgram; | |
| 515 GrGLuint fWireRectArrayBuffer; | |
| 516 | |
| 517 static int TextureTargetToCopyProgramIdx(GrGLenum target) { | 506 static int TextureTargetToCopyProgramIdx(GrGLenum target) { |
| 518 if (target == GR_GL_TEXTURE_2D) { | 507 if (target == GR_GL_TEXTURE_2D) { |
| 519 return 0; | 508 return 0; |
| 520 } else { | 509 } else { |
| 521 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); | 510 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); |
| 522 return 1; | 511 return 1; |
| 523 } | 512 } |
| 524 } | 513 } |
| 525 | 514 |
| 526 TriState fMSAAEnabled; | 515 TriState fMSAAEnabled; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 539 | 528 |
| 540 // 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 |
| 541 // when adding a stencil buffer to a framebuffer. | 530 // when adding a stencil buffer to a framebuffer. |
| 542 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; | 531 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; |
| 543 | 532 |
| 544 typedef GrGpu INHERITED; | 533 typedef GrGpu INHERITED; |
| 545 friend class GrGLPathRendering; // For accessing setTextureUnit. | 534 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 546 }; | 535 }; |
| 547 | 536 |
| 548 #endif | 537 #endif |
| OLD | NEW |