| 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 drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 // This must be paired with a call to unbindSurfaceFBOForCopy(). | 318 // This must be paired with a call to unbindSurfaceFBOForCopy(). |
| 317 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, | 319 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, |
| 318 TempFBOTarget tempFBOTarget); | 320 TempFBOTarget tempFBOTarget); |
| 319 | 321 |
| 320 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co
pying. | 322 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co
pying. |
| 321 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); | 323 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); |
| 322 | 324 |
| 323 SkAutoTUnref<GrGLContext> fGLContext; | 325 SkAutoTUnref<GrGLContext> fGLContext; |
| 324 | 326 |
| 325 void createCopyPrograms(); | 327 void createCopyPrograms(); |
| 328 void createWireRectProgram(); |
| 329 void createUnitRectBuffer(); |
| 326 | 330 |
| 327 // GL program-related state | 331 // GL program-related state |
| 328 ProgramCache* fProgramCache; | 332 ProgramCache* fProgramCache; |
| 329 | 333 |
| 330 /////////////////////////////////////////////////////////////////////////// | 334 /////////////////////////////////////////////////////////////////////////// |
| 331 ///@name Caching of GL State | 335 ///@name Caching of GL State |
| 332 ///@{ | 336 ///@{ |
| 333 int fHWActiveTextureUnitIdx; | 337 int fHWActiveTextureUnitIdx; |
| 334 GrGLuint fHWProgramID; | 338 GrGLuint fHWProgramID; |
| 335 | 339 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 497 |
| 494 /** IDs for copy surface program. */ | 498 /** IDs for copy surface program. */ |
| 495 struct { | 499 struct { |
| 496 GrGLuint fProgram; | 500 GrGLuint fProgram; |
| 497 GrGLint fTextureUniform; | 501 GrGLint fTextureUniform; |
| 498 GrGLint fTexCoordXformUniform; | 502 GrGLint fTexCoordXformUniform; |
| 499 GrGLint fPosXformUniform; | 503 GrGLint fPosXformUniform; |
| 500 } fCopyPrograms[2]; | 504 } fCopyPrograms[2]; |
| 501 GrGLuint fCopyProgramArrayBuffer; | 505 GrGLuint fCopyProgramArrayBuffer; |
| 502 | 506 |
| 507 struct { |
| 508 GrGLuint fProgram; |
| 509 GrGLint fColorUniform; |
| 510 GrGLint fRectUniform; |
| 511 } fWireRectProgram; |
| 512 GrGLuint fWireRectArrayBuffer; |
| 513 |
| 503 static int TextureTargetToCopyProgramIdx(GrGLenum target) { | 514 static int TextureTargetToCopyProgramIdx(GrGLenum target) { |
| 504 if (target == GR_GL_TEXTURE_2D) { | 515 if (target == GR_GL_TEXTURE_2D) { |
| 505 return 0; | 516 return 0; |
| 506 } else { | 517 } else { |
| 507 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); | 518 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); |
| 508 return 1; | 519 return 1; |
| 509 } | 520 } |
| 510 } | 521 } |
| 511 | 522 |
| 512 TriState fMSAAEnabled; | 523 TriState fMSAAEnabled; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 525 | 536 |
| 526 // Mapping of pixel configs to known supported stencil formats to be used | 537 // Mapping of pixel configs to known supported stencil formats to be used |
| 527 // when adding a stencil buffer to a framebuffer. | 538 // when adding a stencil buffer to a framebuffer. |
| 528 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; | 539 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; |
| 529 | 540 |
| 530 typedef GrGpu INHERITED; | 541 typedef GrGpu INHERITED; |
| 531 friend class GrGLPathRendering; // For accessing setTextureUnit. | 542 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 532 }; | 543 }; |
| 533 | 544 |
| 534 #endif | 545 #endif |
| OLD | NEW |