Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: src/gpu/gl/GrGpuGL.cpp

Issue 687563008: Beginning to refactor nvpr code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1864 GR_GL_CALL(gl, StencilOp(glFailOp, glPassOp, glPassOp)); 1864 GR_GL_CALL(gl, StencilOp(glFailOp, glPassOp, glPassOp));
1865 } else { 1865 } else {
1866 GR_GL_CALL(gl, StencilFuncSeparate(glFace, glFunc, ref, mask)); 1866 GR_GL_CALL(gl, StencilFuncSeparate(glFace, glFunc, ref, mask));
1867 GR_GL_CALL(gl, StencilMaskSeparate(glFace, writeMask)); 1867 GR_GL_CALL(gl, StencilMaskSeparate(glFace, writeMask));
1868 GR_GL_CALL(gl, StencilOpSeparate(glFace, glFailOp, glPassOp, glPassOp)); 1868 GR_GL_CALL(gl, StencilOpSeparate(glFace, glFailOp, glPassOp, glPassOp));
1869 } 1869 }
1870 } 1870 }
1871 } 1871 }
1872 1872
1873 void GrGpuGL::flushStencil(const GrStencilSettings& stencilSettings, DrawType ty pe) { 1873 void GrGpuGL::flushStencil(const GrStencilSettings& stencilSettings, DrawType ty pe) {
1874 // TODO figure out why we need to flush stencil settings on path draws at al l
Kimmo Kinnunen 2014/11/03 20:39:12 Can you expand on this, what is the unknown part o
bsalomon 2014/11/03 20:49:34 Our thought was that stencilSettings is more expre
1874 if (kStencilPath_DrawType != type && fHWStencilSettings != stencilSettings) { 1875 if (kStencilPath_DrawType != type && fHWStencilSettings != stencilSettings) {
1875 if (stencilSettings.isDisabled()) { 1876 if (stencilSettings.isDisabled()) {
1876 if (kNo_TriState != fHWStencilTestEnabled) { 1877 if (kNo_TriState != fHWStencilTestEnabled) {
1877 GL_CALL(Disable(GR_GL_STENCIL_TEST)); 1878 GL_CALL(Disable(GR_GL_STENCIL_TEST));
1878 fHWStencilTestEnabled = kNo_TriState; 1879 fHWStencilTestEnabled = kNo_TriState;
1879 } 1880 }
1880 } else { 1881 } else {
1881 if (kYes_TriState != fHWStencilTestEnabled) { 1882 if (kYes_TriState != fHWStencilTestEnabled) {
1882 GL_CALL(Enable(GR_GL_STENCIL_TEST)); 1883 GL_CALL(Enable(GR_GL_STENCIL_TEST));
1883 fHWStencilTestEnabled = kYes_TriState; 1884 fHWStencilTestEnabled = kYes_TriState;
(...skipping 26 matching lines...) Expand all
1910 #if 0 1911 #if 0
1911 // Replace RT_HAS_MSAA with this definition once this driver bug is no longe r a relevant concern 1912 // Replace RT_HAS_MSAA with this definition once this driver bug is no longe r a relevant concern
1912 #define RT_HAS_MSAA rt->isMultisampled() 1913 #define RT_HAS_MSAA rt->isMultisampled()
1913 #else 1914 #else
1914 #define RT_HAS_MSAA (rt->isMultisampled() || kDrawLines_DrawType == type) 1915 #define RT_HAS_MSAA (rt->isMultisampled() || kDrawLines_DrawType == type)
1915 #endif 1916 #endif
1916 1917
1917 const GrRenderTarget* rt = optState.getRenderTarget(); 1918 const GrRenderTarget* rt = optState.getRenderTarget();
1918 if (kGL_GrGLStandard == this->glStandard()) { 1919 if (kGL_GrGLStandard == this->glStandard()) {
1919 if (RT_HAS_MSAA) { 1920 if (RT_HAS_MSAA) {
1920 // FIXME: GL_NV_pr doesn't seem to like MSAA disabled. The paths 1921 bool enableMSAA = optState.isHWAntialiasState();
1921 // convex hulls of each segment appear to get filled.
1922 bool enableMSAA = kStencilPath_DrawType == type ||
1923 optState.isHWAntialiasState();
1924 if (enableMSAA) { 1922 if (enableMSAA) {
1925 if (kYes_TriState != fMSAAEnabled) { 1923 if (kYes_TriState != fMSAAEnabled) {
1926 GL_CALL(Enable(GR_GL_MULTISAMPLE)); 1924 GL_CALL(Enable(GR_GL_MULTISAMPLE));
1927 fMSAAEnabled = kYes_TriState; 1925 fMSAAEnabled = kYes_TriState;
1928 } 1926 }
1929 } else { 1927 } else {
1930 if (kNo_TriState != fMSAAEnabled) { 1928 if (kNo_TriState != fMSAAEnabled) {
1931 GL_CALL(Disable(GR_GL_MULTISAMPLE)); 1929 GL_CALL(Disable(GR_GL_MULTISAMPLE));
1932 fMSAAEnabled = kNo_TriState; 1930 fMSAAEnabled = kNo_TriState;
1933 } 1931 }
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2574 this->setVertexArrayID(gpu, 0); 2572 this->setVertexArrayID(gpu, 0);
2575 } 2573 }
2576 int attrCount = gpu->glCaps().maxVertexAttributes(); 2574 int attrCount = gpu->glCaps().maxVertexAttributes();
2577 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2575 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2578 fDefaultVertexArrayAttribState.resize(attrCount); 2576 fDefaultVertexArrayAttribState.resize(attrCount);
2579 } 2577 }
2580 attribState = &fDefaultVertexArrayAttribState; 2578 attribState = &fDefaultVertexArrayAttribState;
2581 } 2579 }
2582 return attribState; 2580 return attribState;
2583 } 2581 }
OLDNEW
« src/gpu/gl/GrGLPathRendering.cpp ('K') | « src/gpu/gl/GrGLPathRendering.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698