| 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 "GrGLNameAllocator.h" | 10 #include "GrGLNameAllocator.h" |
| (...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1928 if (!drawState->getViewMatrix().hasPerspective() && drawState->getViewIn
verse(&vmi)) { | 1928 if (!drawState->getViewMatrix().hasPerspective() && drawState->getViewIn
verse(&vmi)) { |
| 1929 vmi.mapRect(&bounds); | 1929 vmi.mapRect(&bounds); |
| 1930 // theoretically could set bloat = 0, instead leave it because of ma
trix inversion | 1930 // theoretically could set bloat = 0, instead leave it because of ma
trix inversion |
| 1931 // precision. | 1931 // precision. |
| 1932 SkScalar bloat = drawState->getViewMatrix().getMaxScale() * SK_Scala
rHalf; | 1932 SkScalar bloat = drawState->getViewMatrix().getMaxScale() * SK_Scala
rHalf; |
| 1933 bounds.outset(bloat, bloat); | 1933 bounds.outset(bloat, bloat); |
| 1934 } else { | 1934 } else { |
| 1935 avmr.setIdentity(drawState); | 1935 avmr.setIdentity(drawState); |
| 1936 } | 1936 } |
| 1937 | 1937 |
| 1938 this->drawSimpleRect(bounds, NULL); | 1938 this->drawSimpleRect(bounds); |
| 1939 } | 1939 } |
| 1940 } | 1940 } |
| 1941 | 1941 |
| 1942 void GrGpuGL::onGpuDrawPaths(const GrPathRange* pathRange, | 1942 void GrGpuGL::onGpuDrawPaths(const GrPathRange* pathRange, |
| 1943 const uint32_t indices[], int count, | 1943 const uint32_t indices[], int count, |
| 1944 const float transforms[], PathTransformType transfo
rmsType, | 1944 const float transforms[], PathTransformType transfo
rmsType, |
| 1945 SkPath::FillType fill) { | 1945 SkPath::FillType fill) { |
| 1946 SkASSERT(this->caps()->pathRenderingSupport()); | 1946 SkASSERT(this->caps()->pathRenderingSupport()); |
| 1947 SkASSERT(NULL != this->drawState()->getRenderTarget()); | 1947 SkASSERT(NULL != this->drawState()->getRenderTarget()); |
| 1948 SkASSERT(NULL != this->drawState()->getRenderTarget()->getStencilBuffer()); | 1948 SkASSERT(NULL != this->drawState()->getRenderTarget()->getStencilBuffer()); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2005 if (!drawState->getViewMatrix().hasPerspective() && drawState->getViewIn
verse(&vmi)) { | 2005 if (!drawState->getViewMatrix().hasPerspective() && drawState->getViewIn
verse(&vmi)) { |
| 2006 vmi.mapRect(&bounds); | 2006 vmi.mapRect(&bounds); |
| 2007 // theoretically could set bloat = 0, instead leave it because of ma
trix inversion | 2007 // theoretically could set bloat = 0, instead leave it because of ma
trix inversion |
| 2008 // precision. | 2008 // precision. |
| 2009 SkScalar bloat = drawState->getViewMatrix().getMaxScale() * SK_Scala
rHalf; | 2009 SkScalar bloat = drawState->getViewMatrix().getMaxScale() * SK_Scala
rHalf; |
| 2010 bounds.outset(bloat, bloat); | 2010 bounds.outset(bloat, bloat); |
| 2011 } else { | 2011 } else { |
| 2012 avmr.setIdentity(drawState); | 2012 avmr.setIdentity(drawState); |
| 2013 } | 2013 } |
| 2014 | 2014 |
| 2015 this->drawSimpleRect(bounds, NULL); | 2015 this->drawSimpleRect(bounds); |
| 2016 } | 2016 } |
| 2017 } | 2017 } |
| 2018 | 2018 |
| 2019 void GrGpuGL::onResolveRenderTarget(GrRenderTarget* target) { | 2019 void GrGpuGL::onResolveRenderTarget(GrRenderTarget* target) { |
| 2020 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(target); | 2020 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(target); |
| 2021 if (rt->needsResolve()) { | 2021 if (rt->needsResolve()) { |
| 2022 // Some extensions automatically resolves the texture when it is read. | 2022 // Some extensions automatically resolves the texture when it is read. |
| 2023 if (this->glCaps().usesMSAARenderBuffers()) { | 2023 if (this->glCaps().usesMSAARenderBuffers()) { |
| 2024 SkASSERT(rt->textureFBOID() != rt->renderFBOID()); | 2024 SkASSERT(rt->textureFBOID() != rt->renderFBOID()); |
| 2025 GL_CALL(BindFramebuffer(GR_GL_READ_FRAMEBUFFER, rt->renderFBOID())); | 2025 GL_CALL(BindFramebuffer(GR_GL_READ_FRAMEBUFFER, rt->renderFBOID())); |
| (...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2995 this->setVertexArrayID(gpu, 0); | 2995 this->setVertexArrayID(gpu, 0); |
| 2996 } | 2996 } |
| 2997 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2997 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 2998 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2998 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 2999 fDefaultVertexArrayAttribState.resize(attrCount); | 2999 fDefaultVertexArrayAttribState.resize(attrCount); |
| 3000 } | 3000 } |
| 3001 attribState = &fDefaultVertexArrayAttribState; | 3001 attribState = &fDefaultVertexArrayAttribState; |
| 3002 } | 3002 } |
| 3003 return attribState; | 3003 return attribState; |
| 3004 } | 3004 } |
| OLD | NEW |