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