| 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 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 set_gl_stencil(this->glInterface(), | 1887 set_gl_stencil(this->glInterface(), |
| 1888 stencilSettings, | 1888 stencilSettings, |
| 1889 GR_GL_FRONT_AND_BACK, | 1889 GR_GL_FRONT_AND_BACK, |
| 1890 GrStencilSettings::kFront_Face); | 1890 GrStencilSettings::kFront_Face); |
| 1891 } | 1891 } |
| 1892 } | 1892 } |
| 1893 fHWStencilSettings = stencilSettings; | 1893 fHWStencilSettings = stencilSettings; |
| 1894 } | 1894 } |
| 1895 } | 1895 } |
| 1896 | 1896 |
| 1897 void GrGpuGL::flushAAState(const GrOptDrawState& optState, DrawType type) { | 1897 void GrGpuGL::flushAAState(const GrOptDrawState& optState) { |
| 1898 // At least some ATI linux drivers will render GL_LINES incorrectly when MSAA st
ate is enabled but | 1898 // At least some ATI linux drivers will render GL_LINES incorrectly when MSAA st
ate is enabled but |
| 1899 // the target is not multisampled. Single pixel wide lines are rendered thicker
than 1 pixel wide. | 1899 // the target is not multisampled. Single pixel wide lines are rendered thicker
than 1 pixel wide. |
| 1900 #if 0 | 1900 #if 0 |
| 1901 // Replace RT_HAS_MSAA with this definition once this driver bug is no longe
r a relevant concern | 1901 // Replace RT_HAS_MSAA with this definition once this driver bug is no longe
r a relevant concern |
| 1902 #define RT_HAS_MSAA rt->isMultisampled() | 1902 #define RT_HAS_MSAA rt->isMultisampled() |
| 1903 #else | 1903 #else |
| 1904 #define RT_HAS_MSAA (rt->isMultisampled() || kDrawLines_DrawType == type) | 1904 #define RT_HAS_MSAA (rt->isMultisampled() || kDrawLines_DrawType == optState
.drawType()) |
| 1905 #endif | 1905 #endif |
| 1906 | 1906 |
| 1907 const GrRenderTarget* rt = optState.getRenderTarget(); | 1907 const GrRenderTarget* rt = optState.getRenderTarget(); |
| 1908 if (kGL_GrGLStandard == this->glStandard()) { | 1908 if (kGL_GrGLStandard == this->glStandard()) { |
| 1909 if (RT_HAS_MSAA) { | 1909 if (RT_HAS_MSAA) { |
| 1910 bool enableMSAA = optState.isHWAntialiasState(); | 1910 bool enableMSAA = optState.isHWAntialiasState(); |
| 1911 if (enableMSAA) { | 1911 if (enableMSAA) { |
| 1912 if (kYes_TriState != fMSAAEnabled) { | 1912 if (kYes_TriState != fMSAAEnabled) { |
| 1913 GL_CALL(Enable(GR_GL_MULTISAMPLE)); | 1913 GL_CALL(Enable(GR_GL_MULTISAMPLE)); |
| 1914 fMSAAEnabled = kYes_TriState; | 1914 fMSAAEnabled = kYes_TriState; |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2573 this->setVertexArrayID(gpu, 0); | 2573 this->setVertexArrayID(gpu, 0); |
| 2574 } | 2574 } |
| 2575 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2575 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 2576 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2576 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 2577 fDefaultVertexArrayAttribState.resize(attrCount); | 2577 fDefaultVertexArrayAttribState.resize(attrCount); |
| 2578 } | 2578 } |
| 2579 attribState = &fDefaultVertexArrayAttribState; | 2579 attribState = &fDefaultVertexArrayAttribState; |
| 2580 } | 2580 } |
| 2581 return attribState; | 2581 return attribState; |
| 2582 } | 2582 } |
| OLD | NEW |