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 "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
10 #include "GrGLStencilAttachment.h" | 10 #include "GrGLStencilAttachment.h" |
(...skipping 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2780 if(!SkIRect::IntersectsNoEmptyCheck(dstRect, srcRect)) { | 2780 if(!SkIRect::IntersectsNoEmptyCheck(dstRect, srcRect)) { |
2781 return true; | 2781 return true; |
2782 } | 2782 } |
2783 } else { | 2783 } else { |
2784 return true; | 2784 return true; |
2785 } | 2785 } |
2786 } | 2786 } |
2787 return false; | 2787 return false; |
2788 } | 2788 } |
2789 | 2789 |
2790 void GrGLGpu::xferBarrier(GrXferBarrierType type) { | 2790 void GrGLGpu::xferBarrier(GrRenderTarget* rt, GrXferBarrierType type) { |
2791 switch (type) { | 2791 switch (type) { |
2792 case kTexture_GrXferBarrierType: | 2792 case kTexture_GrXferBarrierType: { |
| 2793 GrGLRenderTarget* glrt = static_cast<GrGLRenderTarget*>(rt); |
| 2794 if (glrt->textureFBOID() != glrt->renderFBOID()) { |
| 2795 // The render target uses separate storage so no need for glText
ureBarrier. |
| 2796 // FIXME: The render target will resolve automatically when its
texture is bound, |
| 2797 // but we could resolve only the bounds that will be read if we
do it here instead. |
| 2798 return; |
| 2799 } |
2793 SkASSERT(this->caps()->textureBarrierSupport()); | 2800 SkASSERT(this->caps()->textureBarrierSupport()); |
2794 GL_CALL(TextureBarrier()); | 2801 GL_CALL(TextureBarrier()); |
2795 return; | 2802 return; |
| 2803 } |
2796 case kBlend_GrXferBarrierType: | 2804 case kBlend_GrXferBarrierType: |
2797 SkASSERT(GrDrawTargetCaps::kAdvanced_BlendEquationSupport == | 2805 SkASSERT(GrDrawTargetCaps::kAdvanced_BlendEquationSupport == |
2798 this->caps()->blendEquationSupport()); | 2806 this->caps()->blendEquationSupport()); |
2799 GL_CALL(BlendBarrier()); | 2807 GL_CALL(BlendBarrier()); |
2800 return; | 2808 return; |
2801 } | 2809 } |
2802 } | 2810 } |
2803 | 2811 |
2804 void GrGLGpu::didAddGpuTraceMarker() { | 2812 void GrGLGpu::didAddGpuTraceMarker() { |
2805 if (this->caps()->gpuTracingSupport()) { | 2813 if (this->caps()->gpuTracingSupport()) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2848 this->setVertexArrayID(gpu, 0); | 2856 this->setVertexArrayID(gpu, 0); |
2849 } | 2857 } |
2850 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2858 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2851 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2859 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2852 fDefaultVertexArrayAttribState.resize(attrCount); | 2860 fDefaultVertexArrayAttribState.resize(attrCount); |
2853 } | 2861 } |
2854 attribState = &fDefaultVertexArrayAttribState; | 2862 attribState = &fDefaultVertexArrayAttribState; |
2855 } | 2863 } |
2856 return attribState; | 2864 return attribState; |
2857 } | 2865 } |
OLD | NEW |