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 | 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 Loading... |
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 Loading... |
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 |
| 2670 void GrGpuGL::onPushGpuTraceEvent(const char* marker) { |
| 2671 if (this->caps()->gpuTracingSupport()) { |
| 2672 // GL_CALL(PushGroupMarker(0, marker)); |
| 2673 } |
| 2674 } |
| 2675 |
| 2676 void GrGpuGL::onPopGpuTraceEvent() { |
| 2677 if (this->caps()->gpuTracingSupport()) { |
| 2678 // GL_CALL(PopGroupMarker()); |
| 2679 } |
| 2680 } |
2666 | 2681 |
2667 /////////////////////////////////////////////////////////////////////////////// | 2682 /////////////////////////////////////////////////////////////////////////////// |
2668 | 2683 |
2669 GrGLAttribArrayState* GrGpuGL::HWGeometryState::bindArrayAndBuffersToDraw( | 2684 GrGLAttribArrayState* GrGpuGL::HWGeometryState::bindArrayAndBuffersToDraw( |
2670 GrGpuGL* gpu, | 2685 GrGpuGL* gpu, |
2671 const GrGLVertexBuffer* vbuffer, | 2686 const GrGLVertexBuffer* vbuffer, |
2672 const GrGLIndexBuffer* ibuffer)
{ | 2687 const GrGLIndexBuffer* ibuffer)
{ |
2673 SkASSERT(NULL != vbuffer); | 2688 SkASSERT(NULL != vbuffer); |
2674 GrGLAttribArrayState* attribState; | 2689 GrGLAttribArrayState* attribState; |
2675 | 2690 |
(...skipping 14 matching lines...) Expand all Loading... |
2690 this->setVertexArrayID(gpu, 0); | 2705 this->setVertexArrayID(gpu, 0); |
2691 } | 2706 } |
2692 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2707 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2693 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2708 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2694 fDefaultVertexArrayAttribState.resize(attrCount); | 2709 fDefaultVertexArrayAttribState.resize(attrCount); |
2695 } | 2710 } |
2696 attribState = &fDefaultVertexArrayAttribState; | 2711 attribState = &fDefaultVertexArrayAttribState; |
2697 } | 2712 } |
2698 return attribState; | 2713 return attribState; |
2699 } | 2714 } |
OLD | NEW |