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 "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2036 | 2036 |
2037 void GrGLGpu::setColocatedSampleLocations(GrRenderTarget* rt, bool useColocatedS
ampleLocations) { | 2037 void GrGLGpu::setColocatedSampleLocations(GrRenderTarget* rt, bool useColocatedS
ampleLocations) { |
2038 GrGLRenderTarget* target = static_cast<GrGLRenderTarget*>(rt->asRenderTarget
()); | 2038 GrGLRenderTarget* target = static_cast<GrGLRenderTarget*>(rt->asRenderTarget
()); |
2039 SkASSERT(0 != target->renderFBOID()); | 2039 SkASSERT(0 != target->renderFBOID()); |
2040 | 2040 |
2041 if (!rt->isStencilBufferMultisampled() || | 2041 if (!rt->isStencilBufferMultisampled() || |
2042 useColocatedSampleLocations == target->usesColocatedSampleLocations()) { | 2042 useColocatedSampleLocations == target->usesColocatedSampleLocations()) { |
2043 return; | 2043 return; |
2044 } | 2044 } |
2045 | 2045 |
2046 if (kGL_GrGLStandard == this->glStandard() && this->glVersion() >= GR_GL_VER
(4,5)) { | 2046 GL_CALL(NamedFramebufferParameteri(target->renderFBOID(), |
2047 GL_CALL(NamedFramebufferParameteri(target->renderFBOID(), | 2047 GR_GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOC
ATIONS, |
2048 GR_GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE
_LOCATIONS, | 2048 useColocatedSampleLocations)); |
2049 useColocatedSampleLocations)); | |
2050 } else { | |
2051 GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, target->renderFBOID())); | |
2052 GL_CALL(FramebufferParameteri(GR_GL_FRAMEBUFFER, | |
2053 GR_GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCA
TIONS, | |
2054 useColocatedSampleLocations)); | |
2055 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; | |
2056 } | |
2057 | 2049 |
2058 target->flagAsUsingColocatedSampleLocations(useColocatedSampleLocations); | 2050 target->flagAsUsingColocatedSampleLocations(useColocatedSampleLocations); |
2059 } | 2051 } |
2060 | 2052 |
2061 void GrGLGpu::flushRenderTarget(GrGLRenderTarget* target, const SkIRect* bound)
{ | 2053 void GrGLGpu::flushRenderTarget(GrGLRenderTarget* target, const SkIRect* bound)
{ |
2062 | 2054 |
2063 SkASSERT(target); | 2055 SkASSERT(target); |
2064 | 2056 |
2065 uint32_t rtID = target->getUniqueID(); | 2057 uint32_t rtID = target->getUniqueID(); |
2066 if (fHWBoundRenderTargetUniqueID != rtID) { | 2058 if (fHWBoundRenderTargetUniqueID != rtID) { |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3357 this->setVertexArrayID(gpu, 0); | 3349 this->setVertexArrayID(gpu, 0); |
3358 } | 3350 } |
3359 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3351 int attrCount = gpu->glCaps().maxVertexAttributes(); |
3360 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3352 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
3361 fDefaultVertexArrayAttribState.resize(attrCount); | 3353 fDefaultVertexArrayAttribState.resize(attrCount); |
3362 } | 3354 } |
3363 attribState = &fDefaultVertexArrayAttribState; | 3355 attribState = &fDefaultVertexArrayAttribState; |
3364 } | 3356 } |
3365 return attribState; | 3357 return attribState; |
3366 } | 3358 } |
OLD | NEW |