| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // that ID is bound. If not the surface is temporarily bound to a FBO and th
at FBO is bound. | 315 // that ID is bound. If not the surface is temporarily bound to a FBO and th
at FBO is bound. |
| 316 // This must be paired with a call to unbindSurfaceFBOForCopy(). | 316 // This must be paired with a call to unbindSurfaceFBOForCopy(). |
| 317 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, | 317 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, |
| 318 TempFBOTarget tempFBOTarget); | 318 TempFBOTarget tempFBOTarget); |
| 319 | 319 |
| 320 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co
pying. | 320 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co
pying. |
| 321 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); | 321 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); |
| 322 | 322 |
| 323 SkAutoTUnref<GrGLContext> fGLContext; | 323 SkAutoTUnref<GrGLContext> fGLContext; |
| 324 | 324 |
| 325 void createCopyPrograms(); | 325 void createCopyProgram(); |
| 326 | 326 |
| 327 // GL program-related state | 327 // GL program-related state |
| 328 ProgramCache* fProgramCache; | 328 ProgramCache* fProgramCache; |
| 329 | 329 |
| 330 /////////////////////////////////////////////////////////////////////////// | 330 /////////////////////////////////////////////////////////////////////////// |
| 331 ///@name Caching of GL State | 331 ///@name Caching of GL State |
| 332 ///@{ | 332 ///@{ |
| 333 int fHWActiveTextureUnitIdx; | 333 int fHWActiveTextureUnitIdx; |
| 334 GrGLuint fHWProgramID; | 334 GrGLuint fHWProgramID; |
| 335 | 335 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 fEnabled = kUnknown_TriState; | 490 fEnabled = kUnknown_TriState; |
| 491 } | 491 } |
| 492 } fHWBlendState; | 492 } fHWBlendState; |
| 493 | 493 |
| 494 /** IDs for copy surface program. */ | 494 /** IDs for copy surface program. */ |
| 495 struct { | 495 struct { |
| 496 GrGLuint fProgram; | 496 GrGLuint fProgram; |
| 497 GrGLint fTextureUniform; | 497 GrGLint fTextureUniform; |
| 498 GrGLint fTexCoordXformUniform; | 498 GrGLint fTexCoordXformUniform; |
| 499 GrGLint fPosXformUniform; | 499 GrGLint fPosXformUniform; |
| 500 } fCopyPrograms[2]; | 500 GrGLuint fArrayBuffer; |
| 501 GrGLuint fCopyProgramArrayBuffer; | 501 } fCopyProgram; |
| 502 | |
| 503 static int TextureTargetToCopyProgramIdx(GrGLenum target) { | |
| 504 if (target == GR_GL_TEXTURE_2D) { | |
| 505 return 0; | |
| 506 } else { | |
| 507 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); | |
| 508 return 1; | |
| 509 } | |
| 510 } | |
| 511 | 502 |
| 512 TriState fMSAAEnabled; | 503 TriState fMSAAEnabled; |
| 513 | 504 |
| 514 GrStencilSettings fHWStencilSettings; | 505 GrStencilSettings fHWStencilSettings; |
| 515 TriState fHWStencilTestEnabled; | 506 TriState fHWStencilTestEnabled; |
| 516 | 507 |
| 517 | 508 |
| 518 GrPipelineBuilder::DrawFace fHWDrawFace; | 509 GrPipelineBuilder::DrawFace fHWDrawFace; |
| 519 TriState fHWWriteToColor; | 510 TriState fHWWriteToColor; |
| 520 uint32_t fHWBoundRenderTargetUniqueID; | 511 uint32_t fHWBoundRenderTargetUniqueID; |
| 521 TriState fHWSRGBFramebuffer; | 512 TriState fHWSRGBFramebuffer; |
| 522 SkTArray<uint32_t, true> fHWBoundTextureUniqueIDs; | 513 SkTArray<uint32_t, true> fHWBoundTextureUniqueIDs; |
| 523 | 514 |
| 524 ///@} | 515 ///@} |
| 525 | 516 |
| 526 // Mapping of pixel configs to known supported stencil formats to be used | 517 // Mapping of pixel configs to known supported stencil formats to be used |
| 527 // when adding a stencil buffer to a framebuffer. | 518 // when adding a stencil buffer to a framebuffer. |
| 528 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; | 519 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; |
| 529 | 520 |
| 530 typedef GrGpu INHERITED; | 521 typedef GrGpu INHERITED; |
| 531 friend class GrGLPathRendering; // For accessing setTextureUnit. | 522 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 532 }; | 523 }; |
| 533 | 524 |
| 534 #endif | 525 #endif |
| OLD | NEW |