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" |
11 #include "GrGLPath.h" | 11 #include "GrGLPath.h" |
12 #include "GrGLShaderBuilder.h" | 12 #include "GrGLShaderBuilder.h" |
13 #include "GrTemplates.h" | 13 #include "GrTemplates.h" |
14 #include "GrTypes.h" | 14 #include "GrTypes.h" |
15 #include "SkStrokeRec.h" | 15 #include "SkStrokeRec.h" |
16 #include "SkTemplates.h" | 16 #include "SkTemplates.h" |
17 | 17 |
18 #include <stdio.h> | |
19 | |
18 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) | 20 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X) |
19 #define GL_CALL_RET(RET, X) GR_GL_CALL_RET(this->glInterface(), RET, X) | 21 #define GL_CALL_RET(RET, X) GR_GL_CALL_RET(this->glInterface(), RET, X) |
20 | 22 |
21 #define SKIP_CACHE_CHECK true | 23 #define SKIP_CACHE_CHECK true |
22 | 24 |
23 #if GR_GL_CHECK_ALLOC_WITH_GET_ERROR | 25 #if GR_GL_CHECK_ALLOC_WITH_GET_ERROR |
24 #define CLEAR_ERROR_BEFORE_ALLOC(iface) GrGLClearErr(iface) | 26 #define CLEAR_ERROR_BEFORE_ALLOC(iface) GrGLClearErr(iface) |
25 #define GL_ALLOC_CALL(iface, call) GR_GL_CALL_NOERRCHECK(iface, call) | 27 #define GL_ALLOC_CALL(iface, call) GR_GL_CALL_NOERRCHECK(iface, call) |
26 #define CHECK_ALLOC_ERROR(iface) GR_GL_GET_ERROR(iface) | 28 #define CHECK_ALLOC_ERROR(iface) GR_GL_GET_ERROR(iface) |
27 #else | 29 #else |
(...skipping 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2654 if(!SkIRect::IntersectsNoEmptyCheck(dstRect, srcRect)) { | 2656 if(!SkIRect::IntersectsNoEmptyCheck(dstRect, srcRect)) { |
2655 return true; | 2657 return true; |
2656 } | 2658 } |
2657 } else { | 2659 } else { |
2658 return true; | 2660 return true; |
2659 } | 2661 } |
2660 } | 2662 } |
2661 return INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint); | 2663 return INHERITED::onCanCopySurface(dst, src, srcRect, dstPoint); |
2662 } | 2664 } |
2663 | 2665 |
2664 void GrGpuGL::onInstantGpuTraceEvent(const char* marker) { | 2666 void GrGpuGL::onAddGpuTraceMarker() { |
2665 if (this->caps()->gpuTracingSupport()) { | 2667 if (this->caps()->gpuTracingSupport()) { |
2666 // GL_CALL(InsertEventMarker(0, marker)); | 2668 SkTDArray<GpuTraceMarker>* markerArray = this->getActiveTraceMarkers(); |
2669 SkString markerString = getTraceString(markerArray, 0, markerArray->coun t()); | |
2670 //(void) markerString; | |
2671 printf("\n%s\n", markerString.c_str()); | |
bsalomon
2014/03/17 17:50:38
I assume this is just leftover debugging stuff
egdaniel
2014/03/17 19:49:12
Yeah again a bunch of debug stuff throughout code
| |
2672 // GL_CALL(PushGroupMarker(0, markerString.c_str())); | |
2667 } | 2673 } |
2668 } | 2674 } |
2669 | 2675 |
2670 void GrGpuGL::onPushGpuTraceEvent(const char* marker) { | 2676 void GrGpuGL::onRemoveGpuTraceMarker() { |
2671 if (this->caps()->gpuTracingSupport()) { | 2677 if (this->caps()->gpuTracingSupport()) { |
2672 // GL_CALL(PushGroupMarker(0, marker)); | 2678 //GL_CALL(PopGroupMarker()); |
2673 } | 2679 } |
2674 } | 2680 } |
2675 | |
2676 void GrGpuGL::onPopGpuTraceEvent() { | |
2677 if (this->caps()->gpuTracingSupport()) { | |
2678 // GL_CALL(PopGroupMarker()); | |
2679 } | |
2680 } | |
2681 | |
2682 /////////////////////////////////////////////////////////////////////////////// | 2681 /////////////////////////////////////////////////////////////////////////////// |
2683 | 2682 |
2684 GrGLAttribArrayState* GrGpuGL::HWGeometryState::bindArrayAndBuffersToDraw( | 2683 GrGLAttribArrayState* GrGpuGL::HWGeometryState::bindArrayAndBuffersToDraw( |
2685 GrGpuGL* gpu, | 2684 GrGpuGL* gpu, |
2686 const GrGLVertexBuffer* vbuffer, | 2685 const GrGLVertexBuffer* vbuffer, |
2687 const GrGLIndexBuffer* ibuffer) { | 2686 const GrGLIndexBuffer* ibuffer) { |
2688 SkASSERT(NULL != vbuffer); | 2687 SkASSERT(NULL != vbuffer); |
2689 GrGLAttribArrayState* attribState; | 2688 GrGLAttribArrayState* attribState; |
2690 | 2689 |
2691 // We use a vertex array if we're on a core profile and the verts are in a V BO. | 2690 // We use a vertex array if we're on a core profile and the verts are in a V BO. |
(...skipping 13 matching lines...) Expand all Loading... | |
2705 this->setVertexArrayID(gpu, 0); | 2704 this->setVertexArrayID(gpu, 0); |
2706 } | 2705 } |
2707 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2706 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2708 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2707 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2709 fDefaultVertexArrayAttribState.resize(attrCount); | 2708 fDefaultVertexArrayAttribState.resize(attrCount); |
2710 } | 2709 } |
2711 attribState = &fDefaultVertexArrayAttribState; | 2710 attribState = &fDefaultVertexArrayAttribState; |
2712 } | 2711 } |
2713 return attribState; | 2712 return attribState; |
2714 } | 2713 } |
OLD | NEW |