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

Side by Side Diff: src/gpu/gl/GrGpuGL.cpp

Issue 174123003: Add hooks for GL_EXT_debug_marker in gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Upload failed. Trying again Created 6 years, 10 months 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 8
9 #include "GrGpuGL.h" 9 #include "GrGpuGL.h"
10 #include "GrGLStencilBuffer.h" 10 #include "GrGLStencilBuffer.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 /////////////////////////////////////////////////////////////////////////////// 111 ///////////////////////////////////////////////////////////////////////////////
112 112
113 static bool gPrintStartupSpew; 113 static bool gPrintStartupSpew;
114 114
115 GrGpuGL::GrGpuGL(const GrGLContext& ctx, GrContext* context) 115 GrGpuGL::GrGpuGL(const GrGLContext& ctx, GrContext* context)
116 : GrGpu(context) 116 : GrGpu(context)
117 , fGLContext(ctx) { 117 , fGLContext(ctx) {
118 118
119 SkASSERT(ctx.isInitialized()); 119 SkASSERT(ctx.isInitialized());
120
121 fCaps.reset(SkRef(ctx.caps())); 120 fCaps.reset(SkRef(ctx.caps()));
122 121
123 fHWBoundTextures.reset(this->glCaps().maxFragmentTextureUnits()); 122 fHWBoundTextures.reset(this->glCaps().maxFragmentTextureUnits());
124 fHWTexGenSettings.reset(this->glCaps().maxFixedFunctionTextureCoords()); 123 fHWTexGenSettings.reset(this->glCaps().maxFixedFunctionTextureCoords());
125 124
126 GrGLClearErr(fGLContext.interface()); 125 GrGLClearErr(fGLContext.interface());
127
128 if (gPrintStartupSpew) { 126 if (gPrintStartupSpew) {
129 const GrGLubyte* vendor; 127 const GrGLubyte* vendor;
130 const GrGLubyte* renderer; 128 const GrGLubyte* renderer;
131 const GrGLubyte* version; 129 const GrGLubyte* version;
132 GL_CALL_RET(vendor, GetString(GR_GL_VENDOR)); 130 GL_CALL_RET(vendor, GetString(GR_GL_VENDOR));
133 GL_CALL_RET(renderer, GetString(GR_GL_RENDERER)); 131 GL_CALL_RET(renderer, GetString(GR_GL_RENDERER));
134 GL_CALL_RET(version, GetString(GR_GL_VERSION)); 132 GL_CALL_RET(version, GetString(GR_GL_VERSION));
135 GrPrintf("------------------------- create GrGpuGL %p --------------\n", 133 GrPrintf("------------------------- create GrGpuGL %p --------------\n",
136 this); 134 this);
137 GrPrintf("------ VENDOR %s\n", vendor); 135 GrPrintf("------ VENDOR %s\n", vendor);
(...skipping 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after
2656 if(!SkIRect::IntersectsNoEmptyCheck(dstRect, srcRect)) { 2654 if(!SkIRect::IntersectsNoEmptyCheck(dstRect, srcRect)) {
2657 return true; 2655 return true;
2658 } 2656 }
2659 } else { 2657 } else {
2660 return true; 2658 return true;
2661 } 2659 }
2662 } 2660 }
2663 return INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint); 2661 return INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint);
2664 } 2662 }
2665 2663
2664 void GrGpuGL::onInstantGpuTraceEvent(const char* marker){
2665 if (this->caps()->gpuTracingSupport()) {
2666 // GL_CALL(InsertEventMarker(0, marker));
2667 }
2668 }
2669 void GrGpuGL::onPushGpuTraceEvent(const char* marker){
bsalomon 2014/02/21 17:03:07 spaces between function defns.
2670 if (this->caps()->gpuTracingSupport()) {
2671 // GL_CALL(PushGroupMarker(0, marker));
2672 }
2673 }
2674 void GrGpuGL::onPopGpuTraceEvent(){
2675 if (this->caps()->gpuTracingSupport()) {
2676 // GL_CALL(PopGroupMarker());
2677 }
2678 }
2666 2679
2667 /////////////////////////////////////////////////////////////////////////////// 2680 ///////////////////////////////////////////////////////////////////////////////
2668 2681
2669 GrGLAttribArrayState* GrGpuGL::HWGeometryState::bindArrayAndBuffersToDraw( 2682 GrGLAttribArrayState* GrGpuGL::HWGeometryState::bindArrayAndBuffersToDraw(
2670 GrGpuGL* gpu, 2683 GrGpuGL* gpu,
2671 const GrGLVertexBuffer* vbuffer, 2684 const GrGLVertexBuffer* vbuffer,
2672 const GrGLIndexBuffer* ibuffer) { 2685 const GrGLIndexBuffer* ibuffer) {
2673 SkASSERT(NULL != vbuffer); 2686 SkASSERT(NULL != vbuffer);
2674 GrGLAttribArrayState* attribState; 2687 GrGLAttribArrayState* attribState;
2675 2688
(...skipping 14 matching lines...) Expand all
2690 this->setVertexArrayID(gpu, 0); 2703 this->setVertexArrayID(gpu, 0);
2691 } 2704 }
2692 int attrCount = gpu->glCaps().maxVertexAttributes(); 2705 int attrCount = gpu->glCaps().maxVertexAttributes();
2693 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2706 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2694 fDefaultVertexArrayAttribState.resize(attrCount); 2707 fDefaultVertexArrayAttribState.resize(attrCount);
2695 } 2708 }
2696 attribState = &fDefaultVertexArrayAttribState; 2709 attribState = &fDefaultVertexArrayAttribState;
2697 } 2710 }
2698 return attribState; 2711 return attribState;
2699 } 2712 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698