Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Side by Side Diff: src/gpu/gl/GrGLGpu.h

Issue 1494473005: Add option to draw wireframe batch bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
133 private: 135 private:
134 GrGLGpu(GrGLContext* ctx, GrContext* context); 136 GrGLGpu(GrGLContext* ctx, GrContext* context);
135 137
136 // GrGpu overrides 138 // GrGpu overrides
137 void onResetContext(uint32_t resetBits) override; 139 void onResetContext(uint32_t resetBits) override;
138 140
139 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; 141 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override;
140 142
141 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle, 143 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle,
142 const void* srcData, size_t rowBytes) override; 144 const void* srcData, size_t rowBytes) override;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // This must be paired with a call to unbindSurfaceFBOForCopy(). 321 // This must be paired with a call to unbindSurfaceFBOForCopy().
320 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect * viewport, 322 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect * viewport,
321 TempFBOTarget tempFBOTarget); 323 TempFBOTarget tempFBOTarget);
322 324
323 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co pying. 325 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co pying.
324 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); 326 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface);
325 327
326 SkAutoTUnref<GrGLContext> fGLContext; 328 SkAutoTUnref<GrGLContext> fGLContext;
327 329
328 void createCopyPrograms(); 330 void createCopyPrograms();
331 void createWireRectProgram();
332 void createUnitRectBuffer();
329 333
330 // GL program-related state 334 // GL program-related state
331 ProgramCache* fProgramCache; 335 ProgramCache* fProgramCache;
332 336
333 /////////////////////////////////////////////////////////////////////////// 337 ///////////////////////////////////////////////////////////////////////////
334 ///@name Caching of GL State 338 ///@name Caching of GL State
335 ///@{ 339 ///@{
336 int fHWActiveTextureUnitIdx; 340 int fHWActiveTextureUnitIdx;
337 GrGLuint fHWProgramID; 341 GrGLuint fHWProgramID;
338 342
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 500
497 /** IDs for copy surface program. */ 501 /** IDs for copy surface program. */
498 struct { 502 struct {
499 GrGLuint fProgram; 503 GrGLuint fProgram;
500 GrGLint fTextureUniform; 504 GrGLint fTextureUniform;
501 GrGLint fTexCoordXformUniform; 505 GrGLint fTexCoordXformUniform;
502 GrGLint fPosXformUniform; 506 GrGLint fPosXformUniform;
503 } fCopyPrograms[2]; 507 } fCopyPrograms[2];
504 GrGLuint fCopyProgramArrayBuffer; 508 GrGLuint fCopyProgramArrayBuffer;
505 509
510 struct {
511 GrGLuint fProgram;
512 GrGLint fColorUniform;
513 GrGLint fRectUniform;
514 } fWireRectProgram;
515 GrGLuint fWireRectArrayBuffer;
516
506 static int TextureTargetToCopyProgramIdx(GrGLenum target) { 517 static int TextureTargetToCopyProgramIdx(GrGLenum target) {
507 if (target == GR_GL_TEXTURE_2D) { 518 if (target == GR_GL_TEXTURE_2D) {
508 return 0; 519 return 0;
509 } else { 520 } else {
510 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); 521 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL);
511 return 1; 522 return 1;
512 } 523 }
513 } 524 }
514 525
515 TriState fMSAAEnabled; 526 TriState fMSAAEnabled;
(...skipping 12 matching lines...) Expand all
528 539
529 // Mapping of pixel configs to known supported stencil formats to be used 540 // Mapping of pixel configs to known supported stencil formats to be used
530 // when adding a stencil buffer to a framebuffer. 541 // when adding a stencil buffer to a framebuffer.
531 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; 542 int fPixelConfigToStencilIndex[kGrPixelConfigCnt];
532 543
533 typedef GrGpu INHERITED; 544 typedef GrGpu INHERITED;
534 friend class GrGLPathRendering; // For accessing setTextureUnit. 545 friend class GrGLPathRendering; // For accessing setTextureUnit.
535 }; 546 };
536 547
537 #endif 548 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698