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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 // Vertex | 359 // Vertex |
360 if (resetBits & kVertex_GrGLBackendState) { | 360 if (resetBits & kVertex_GrGLBackendState) { |
361 fHWGeometryState.invalidate(); | 361 fHWGeometryState.invalidate(); |
362 } | 362 } |
363 | 363 |
364 if (resetBits & kRenderTarget_GrGLBackendState) { | 364 if (resetBits & kRenderTarget_GrGLBackendState) { |
365 fHWBoundRenderTarget = NULL; | 365 fHWBoundRenderTarget = NULL; |
366 } | 366 } |
367 | 367 |
368 if (resetBits & kFixedFunction_GrGLBackendState && this->glCaps().fixedFunct
ionSupport()) { | 368 if (resetBits & (kFixedFunction_GrGLBackendState | kPathRendering_GrGLBacken
dState)) { |
| 369 if (this->glCaps().fixedFunctionSupport()) { |
| 370 fHWProjectionMatrixState.invalidate(); |
| 371 // we don't use the model view matrix. |
| 372 GL_CALL(MatrixMode(GR_GL_MODELVIEW)); |
| 373 GL_CALL(LoadIdentity()); |
369 | 374 |
370 fHWProjectionMatrixState.invalidate(); | 375 for (int i = 0; i < this->glCaps().maxFixedFunctionTextureCoords();
++i) { |
371 // we don't use the model view matrix. | 376 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + i)); |
372 GL_CALL(MatrixMode(GR_GL_MODELVIEW)); | 377 GL_CALL(Disable(GR_GL_TEXTURE_GEN_S)); |
373 GL_CALL(LoadIdentity()); | 378 GL_CALL(Disable(GR_GL_TEXTURE_GEN_T)); |
374 | 379 GL_CALL(Disable(GR_GL_TEXTURE_GEN_Q)); |
375 for (int i = 0; i < this->glCaps().maxFixedFunctionTextureCoords(); ++i)
{ | 380 GL_CALL(Disable(GR_GL_TEXTURE_GEN_R)); |
376 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + i)); | 381 if (this->caps()->pathRenderingSupport()) { |
377 GL_CALL(Disable(GR_GL_TEXTURE_GEN_S)); | 382 GL_CALL(PathTexGen(GR_GL_TEXTURE0 + i, GR_GL_NONE, 0, NULL))
; |
378 GL_CALL(Disable(GR_GL_TEXTURE_GEN_T)); | 383 } |
379 GL_CALL(Disable(GR_GL_TEXTURE_GEN_Q)); | 384 fHWTexGenSettings[i].fMode = GR_GL_NONE; |
380 GL_CALL(Disable(GR_GL_TEXTURE_GEN_R)); | 385 fHWTexGenSettings[i].fNumComponents = 0; |
381 if (this->caps()->pathStencilingSupport()) { | |
382 GL_CALL(PathTexGen(GR_GL_TEXTURE0 + i, GR_GL_NONE, 0, NULL)); | |
383 } | 386 } |
384 fHWTexGenSettings[i].fMode = GR_GL_NONE; | 387 fHWActiveTexGenSets = 0; |
385 fHWTexGenSettings[i].fNumComponents = 0; | |
386 } | 388 } |
387 fHWActiveTexGenSets = 0; | 389 if (this->caps()->pathRenderingSupport()) { |
| 390 fHWPathStencilSettings.invalidate(); |
| 391 } |
388 } | 392 } |
389 | 393 |
390 // we assume these values | 394 // we assume these values |
391 if (resetBits & kPixelStore_GrGLBackendState) { | 395 if (resetBits & kPixelStore_GrGLBackendState) { |
392 if (this->glCaps().unpackRowLengthSupport()) { | 396 if (this->glCaps().unpackRowLengthSupport()) { |
393 GL_CALL(PixelStorei(GR_GL_UNPACK_ROW_LENGTH, 0)); | 397 GL_CALL(PixelStorei(GR_GL_UNPACK_ROW_LENGTH, 0)); |
394 } | 398 } |
395 if (this->glCaps().packRowLengthSupport()) { | 399 if (this->glCaps().packRowLengthSupport()) { |
396 GL_CALL(PixelStorei(GR_GL_PACK_ROW_LENGTH, 0)); | 400 GL_CALL(PixelStorei(GR_GL_PACK_ROW_LENGTH, 0)); |
397 } | 401 } |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 return NULL; | 1270 return NULL; |
1267 } | 1271 } |
1268 GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer, (this, desc
)); | 1272 GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer, (this, desc
)); |
1269 return indexBuffer; | 1273 return indexBuffer; |
1270 } | 1274 } |
1271 return NULL; | 1275 return NULL; |
1272 } | 1276 } |
1273 } | 1277 } |
1274 | 1278 |
1275 GrPath* GrGpuGL::onCreatePath(const SkPath& inPath) { | 1279 GrPath* GrGpuGL::onCreatePath(const SkPath& inPath) { |
1276 SkASSERT(this->caps()->pathStencilingSupport()); | 1280 SkASSERT(this->caps()->pathRenderingSupport()); |
1277 return SkNEW_ARGS(GrGLPath, (this, inPath)); | 1281 return SkNEW_ARGS(GrGLPath, (this, inPath)); |
1278 } | 1282 } |
1279 | 1283 |
1280 void GrGpuGL::flushScissor() { | 1284 void GrGpuGL::flushScissor() { |
1281 if (fScissorState.fEnabled) { | 1285 if (fScissorState.fEnabled) { |
1282 // Only access the RT if scissoring is being enabled. We can call this b
efore performing | 1286 // Only access the RT if scissoring is being enabled. We can call this b
efore performing |
1283 // a glBitframebuffer for a surface->surface copy, which requires no RT
to be bound to the | 1287 // a glBitframebuffer for a surface->surface copy, which requires no RT
to be bound to the |
1284 // GrDrawState. | 1288 // GrDrawState. |
1285 const GrDrawState& drawState = this->getDrawState(); | 1289 const GrDrawState& drawState = this->getDrawState(); |
1286 const GrGLRenderTarget* rt = | 1290 const GrGLRenderTarget* rt = |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 int set_a_break_pt_here = 9; | 1663 int set_a_break_pt_here = 9; |
1660 aglSwapBuffers(aglGetCurrentContext()); | 1664 aglSwapBuffers(aglGetCurrentContext()); |
1661 #elif defined(SK_BUILD_FOR_WIN32) | 1665 #elif defined(SK_BUILD_FOR_WIN32) |
1662 SwapBuf(); | 1666 SwapBuf(); |
1663 int set_a_break_pt_here = 9; | 1667 int set_a_break_pt_here = 9; |
1664 SwapBuf(); | 1668 SwapBuf(); |
1665 #endif | 1669 #endif |
1666 #endif | 1670 #endif |
1667 } | 1671 } |
1668 | 1672 |
1669 namespace { | 1673 static GrGLenum gr_stencil_op_to_gl_path_rendering_fill_mode(GrStencilOp op) { |
1670 | 1674 switch (op) { |
1671 static const uint16_t kOnes16 = static_cast<uint16_t>(~0); | |
1672 const GrStencilSettings& winding_nv_path_stencil_settings() { | |
1673 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, | |
1674 kIncClamp_StencilOp, | |
1675 kIncClamp_StencilOp, | |
1676 kAlwaysIfInClip_StencilFunc, | |
1677 kOnes16, kOnes16, kOnes16); | |
1678 return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings); | |
1679 } | |
1680 const GrStencilSettings& even_odd_nv_path_stencil_settings() { | |
1681 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, | |
1682 kInvert_StencilOp, | |
1683 kInvert_StencilOp, | |
1684 kAlwaysIfInClip_StencilFunc, | |
1685 kOnes16, kOnes16, kOnes16); | |
1686 return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings); | |
1687 } | |
1688 } | |
1689 | |
1690 void GrGpuGL::setStencilPathSettings(const GrPath&, | |
1691 SkPath::FillType fill, | |
1692 GrStencilSettings* settings) { | |
1693 switch (fill) { | |
1694 case SkPath::kEvenOdd_FillType: | |
1695 *settings = even_odd_nv_path_stencil_settings(); | |
1696 return; | |
1697 case SkPath::kWinding_FillType: | |
1698 *settings = winding_nv_path_stencil_settings(); | |
1699 return; | |
1700 default: | 1675 default: |
1701 GrCrash("Unexpected path fill."); | 1676 GrCrash("Unexpected path fill."); |
| 1677 /* fallthrough */; |
| 1678 case kIncClamp_StencilOp: |
| 1679 return GR_GL_COUNT_UP; |
| 1680 case kInvert_StencilOp: |
| 1681 return GR_GL_INVERT; |
1702 } | 1682 } |
1703 } | 1683 } |
1704 | 1684 |
1705 void GrGpuGL::onGpuStencilPath(const GrPath* path, SkPath::FillType fill) { | 1685 void GrGpuGL::onGpuStencilPath(const GrPath* path, SkPath::FillType fill) { |
1706 SkASSERT(this->caps()->pathStencilingSupport()); | 1686 SkASSERT(this->caps()->pathRenderingSupport()); |
1707 | 1687 |
1708 GrGLuint id = static_cast<const GrGLPath*>(path)->pathID(); | 1688 GrGLuint id = static_cast<const GrGLPath*>(path)->pathID(); |
1709 GrDrawState* drawState = this->drawState(); | 1689 SkASSERT(NULL != this->drawState()->getRenderTarget()); |
1710 SkASSERT(NULL != drawState->getRenderTarget()); | 1690 SkASSERT(NULL != this->drawState()->getRenderTarget()->getStencilBuffer()); |
1711 if (NULL == drawState->getRenderTarget()->getStencilBuffer()) { | 1691 |
1712 return; | 1692 flushPathStencilSettings(fill); |
1713 } | |
1714 | 1693 |
1715 // Decide how to manipulate the stencil buffer based on the fill rule. | 1694 // Decide how to manipulate the stencil buffer based on the fill rule. |
1716 // Also, assert that the stencil settings we set in setStencilPathSettings | 1695 SkASSERT(!fHWPathStencilSettings.isTwoSided()); |
1717 // are present. | 1696 |
1718 SkASSERT(!fStencilSettings.isTwoSided()); | 1697 GrGLenum fillMode = |
1719 GrGLenum fillMode; | 1698 gr_stencil_op_to_gl_path_rendering_fill_mode(fHWPathStencilSettings.pass
Op(GrStencilSettings::kFront_Face)); |
1720 switch (fill) { | 1699 GrGLint writeMask = fHWPathStencilSettings.writeMask(GrStencilSettings::kFro
nt_Face); |
1721 case SkPath::kWinding_FillType: | |
1722 fillMode = GR_GL_COUNT_UP; | |
1723 SkASSERT(kIncClamp_StencilOp == | |
1724 fStencilSettings.passOp(GrStencilSettings::kFront_Face)); | |
1725 SkASSERT(kIncClamp_StencilOp == | |
1726 fStencilSettings.failOp(GrStencilSettings::kFront_Face)); | |
1727 break; | |
1728 case SkPath::kEvenOdd_FillType: | |
1729 fillMode = GR_GL_INVERT; | |
1730 SkASSERT(kInvert_StencilOp == | |
1731 fStencilSettings.passOp(GrStencilSettings::kFront_Face)); | |
1732 SkASSERT(kInvert_StencilOp == | |
1733 fStencilSettings.failOp(GrStencilSettings::kFront_Face)); | |
1734 break; | |
1735 default: | |
1736 // Only the above two fill rules are allowed. | |
1737 GrCrash("Unexpected path fill."); | |
1738 return; // suppress unused var warning. | |
1739 } | |
1740 GrGLint writeMask = fStencilSettings.writeMask(GrStencilSettings::kFront_Fac
e); | |
1741 GL_CALL(StencilFillPath(id, fillMode, writeMask)); | 1700 GL_CALL(StencilFillPath(id, fillMode, writeMask)); |
1742 } | 1701 } |
1743 | 1702 |
| 1703 void GrGpuGL::onGpuFillPath(const GrPath* path, SkPath::FillType fill) { |
| 1704 SkASSERT(this->caps()->pathRenderingSupport()); |
| 1705 |
| 1706 GrGLuint id = static_cast<const GrGLPath*>(path)->pathID(); |
| 1707 SkASSERT(NULL != this->drawState()->getRenderTarget()); |
| 1708 SkASSERT(NULL != this->drawState()->getRenderTarget()->getStencilBuffer()); |
| 1709 SkASSERT(!fCurrentProgram->hasVertexShader()); |
| 1710 |
| 1711 flushPathStencilSettings(fill); |
| 1712 |
| 1713 SkPath::FillType nonInvertedFill = SkPath::ConvertToNonInverseFillType(fill)
; |
| 1714 SkASSERT(!fHWPathStencilSettings.isTwoSided()); |
| 1715 GrGLenum fillMode = |
| 1716 gr_stencil_op_to_gl_path_rendering_fill_mode(fHWPathStencilSettings.pass
Op(GrStencilSettings::kFront_Face)); |
| 1717 GrGLint writeMask = fHWPathStencilSettings.writeMask(GrStencilSettings::kFro
nt_Face); |
| 1718 GL_CALL(StencilFillPath(id, fillMode, writeMask)); |
| 1719 |
| 1720 if (nonInvertedFill == fill) { |
| 1721 GL_CALL(CoverFillPath(id, GR_GL_BOUNDING_BOX)); |
| 1722 } else { |
| 1723 GrDrawState* drawState = this->drawState(); |
| 1724 GrDrawState::AutoViewMatrixRestore avmr; |
| 1725 SkRect bounds = SkRect::MakeLTRB(0, 0, |
| 1726 SkIntToScalar(drawState->getRenderTarge
t()->width()), |
| 1727 SkIntToScalar(drawState->getRenderTarge
t()->height())); |
| 1728 SkMatrix vmi; |
| 1729 // mapRect through persp matrix may not be correct |
| 1730 if (!drawState->getViewMatrix().hasPerspective() && drawState->getViewIn
verse(&vmi)) { |
| 1731 vmi.mapRect(&bounds); |
| 1732 // theoretically could set bloat = 0, instead leave it because of ma
trix inversion |
| 1733 // precision. |
| 1734 SkScalar bloat = drawState->getViewMatrix().getMaxStretch() * SK_Sca
larHalf; |
| 1735 bounds.outset(bloat, bloat); |
| 1736 } else { |
| 1737 avmr.setIdentity(drawState); |
| 1738 } |
| 1739 |
| 1740 this->drawSimpleRect(bounds, NULL); |
| 1741 } |
| 1742 } |
| 1743 |
1744 void GrGpuGL::onResolveRenderTarget(GrRenderTarget* target) { | 1744 void GrGpuGL::onResolveRenderTarget(GrRenderTarget* target) { |
1745 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(target); | 1745 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(target); |
1746 if (rt->needsResolve()) { | 1746 if (rt->needsResolve()) { |
1747 // Some extensions automatically resolves the texture when it is read. | 1747 // Some extensions automatically resolves the texture when it is read. |
1748 if (this->glCaps().usesMSAARenderBuffers()) { | 1748 if (this->glCaps().usesMSAARenderBuffers()) { |
1749 SkASSERT(rt->textureFBOID() != rt->renderFBOID()); | 1749 SkASSERT(rt->textureFBOID() != rt->renderFBOID()); |
1750 GL_CALL(BindFramebuffer(GR_GL_READ_FRAMEBUFFER, rt->renderFBOID())); | 1750 GL_CALL(BindFramebuffer(GR_GL_READ_FRAMEBUFFER, rt->renderFBOID())); |
1751 GL_CALL(BindFramebuffer(GR_GL_DRAW_FRAMEBUFFER, rt->textureFBOID()))
; | 1751 GL_CALL(BindFramebuffer(GR_GL_DRAW_FRAMEBUFFER, rt->textureFBOID()))
; |
1752 // make sure we go through flushRenderTarget() since we've modified | 1752 // make sure we go through flushRenderTarget() since we've modified |
1753 // the bound DRAW FBO ID. | 1753 // the bound DRAW FBO ID. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1855 GR_GL_CALL(gl, StencilOp(glFailOp, glPassOp, glPassOp)); | 1855 GR_GL_CALL(gl, StencilOp(glFailOp, glPassOp, glPassOp)); |
1856 } else { | 1856 } else { |
1857 GR_GL_CALL(gl, StencilFuncSeparate(glFace, glFunc, ref, mask)); | 1857 GR_GL_CALL(gl, StencilFuncSeparate(glFace, glFunc, ref, mask)); |
1858 GR_GL_CALL(gl, StencilMaskSeparate(glFace, writeMask)); | 1858 GR_GL_CALL(gl, StencilMaskSeparate(glFace, writeMask)); |
1859 GR_GL_CALL(gl, StencilOpSeparate(glFace, glFailOp, glPassOp, glPassOp)); | 1859 GR_GL_CALL(gl, StencilOpSeparate(glFace, glFailOp, glPassOp, glPassOp)); |
1860 } | 1860 } |
1861 } | 1861 } |
1862 } | 1862 } |
1863 | 1863 |
1864 void GrGpuGL::flushStencil(DrawType type) { | 1864 void GrGpuGL::flushStencil(DrawType type) { |
1865 if (kStencilPath_DrawType == type) { | 1865 if (kStencilPath_DrawType != type && fHWStencilSettings != fStencilSettings)
{ |
1866 SkASSERT(!fStencilSettings.isTwoSided()); | |
1867 // Just the func, ref, and mask is set here. The op and write mask are p
arams to the call | |
1868 // that draws the path to the SB (glStencilFillPath) | |
1869 GrGLenum func = | |
1870 gr_to_gl_stencil_func(fStencilSettings.func(GrStencilSettings::kFron
t_Face)); | |
1871 GL_CALL(PathStencilFunc(func, | |
1872 fStencilSettings.funcRef(GrStencilSettings::kFro
nt_Face), | |
1873 fStencilSettings.funcMask(GrStencilSettings::kFr
ont_Face))); | |
1874 } else if (fHWStencilSettings != fStencilSettings) { | |
1875 if (fStencilSettings.isDisabled()) { | 1866 if (fStencilSettings.isDisabled()) { |
1876 if (kNo_TriState != fHWStencilTestEnabled) { | 1867 if (kNo_TriState != fHWStencilTestEnabled) { |
1877 GL_CALL(Disable(GR_GL_STENCIL_TEST)); | 1868 GL_CALL(Disable(GR_GL_STENCIL_TEST)); |
1878 fHWStencilTestEnabled = kNo_TriState; | 1869 fHWStencilTestEnabled = kNo_TriState; |
1879 } | 1870 } |
1880 } else { | 1871 } else { |
1881 if (kYes_TriState != fHWStencilTestEnabled) { | 1872 if (kYes_TriState != fHWStencilTestEnabled) { |
1882 GL_CALL(Enable(GR_GL_STENCIL_TEST)); | 1873 GL_CALL(Enable(GR_GL_STENCIL_TEST)); |
1883 fHWStencilTestEnabled = kYes_TriState; | 1874 fHWStencilTestEnabled = kYes_TriState; |
1884 } | 1875 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1954 } else { | 1945 } else { |
1955 if (kNo_TriState != fHWAAState.fMSAAEnabled) { | 1946 if (kNo_TriState != fHWAAState.fMSAAEnabled) { |
1956 GL_CALL(Disable(GR_GL_MULTISAMPLE)); | 1947 GL_CALL(Disable(GR_GL_MULTISAMPLE)); |
1957 fHWAAState.fMSAAEnabled = kNo_TriState; | 1948 fHWAAState.fMSAAEnabled = kNo_TriState; |
1958 } | 1949 } |
1959 } | 1950 } |
1960 } | 1951 } |
1961 } | 1952 } |
1962 } | 1953 } |
1963 | 1954 |
| 1955 void GrGpuGL::flushPathStencilSettings(SkPath::FillType fill) { |
| 1956 GrStencilSettings pathStencilSettings; |
| 1957 this->getPathStencilSettingsForFillType(fill, &pathStencilSettings); |
| 1958 if (fHWPathStencilSettings != pathStencilSettings) { |
| 1959 // Just the func, ref, and mask is set here. The op and write mask are p
arams to the call |
| 1960 // that draws the path to the SB (glStencilFillPath) |
| 1961 GrGLenum func = |
| 1962 gr_to_gl_stencil_func(pathStencilSettings.func(GrStencilSettings::kF
ront_Face)); |
| 1963 GL_CALL(PathStencilFunc(func, |
| 1964 pathStencilSettings.funcRef(GrStencilSettings::k
Front_Face), |
| 1965 pathStencilSettings.funcMask(GrStencilSettings::
kFront_Face))); |
| 1966 |
| 1967 fHWPathStencilSettings = pathStencilSettings; |
| 1968 } |
| 1969 } |
| 1970 |
1964 void GrGpuGL::flushBlend(bool isLines, | 1971 void GrGpuGL::flushBlend(bool isLines, |
1965 GrBlendCoeff srcCoeff, | 1972 GrBlendCoeff srcCoeff, |
1966 GrBlendCoeff dstCoeff) { | 1973 GrBlendCoeff dstCoeff) { |
1967 if (isLines && this->willUseHWAALines()) { | 1974 if (isLines && this->willUseHWAALines()) { |
1968 if (kYes_TriState != fHWBlendState.fEnabled) { | 1975 if (kYes_TriState != fHWBlendState.fEnabled) { |
1969 GL_CALL(Enable(GR_GL_BLEND)); | 1976 GL_CALL(Enable(GR_GL_BLEND)); |
1970 fHWBlendState.fEnabled = kYes_TriState; | 1977 fHWBlendState.fEnabled = kYes_TriState; |
1971 } | 1978 } |
1972 if (kSA_GrBlendCoeff != fHWBlendState.fSrcCoeff || | 1979 if (kSA_GrBlendCoeff != fHWBlendState.fSrcCoeff || |
1973 kISA_GrBlendCoeff != fHWBlendState.fDstCoeff) { | 1980 kISA_GrBlendCoeff != fHWBlendState.fDstCoeff) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2141 fHWProjectionMatrixState.getGLMatrix<4>(glMatrix); | 2148 fHWProjectionMatrixState.getGLMatrix<4>(glMatrix); |
2142 GL_CALL(MatrixMode(GR_GL_PROJECTION)); | 2149 GL_CALL(MatrixMode(GR_GL_PROJECTION)); |
2143 GL_CALL(LoadMatrixf(glMatrix)); | 2150 GL_CALL(LoadMatrixf(glMatrix)); |
2144 } | 2151 } |
2145 | 2152 |
2146 void GrGpuGL::enableTexGen(int unitIdx, | 2153 void GrGpuGL::enableTexGen(int unitIdx, |
2147 TexGenComponents components, | 2154 TexGenComponents components, |
2148 const GrGLfloat* coefficients) { | 2155 const GrGLfloat* coefficients) { |
2149 | 2156 |
2150 SkASSERT(this->glCaps().fixedFunctionSupport()); | 2157 SkASSERT(this->glCaps().fixedFunctionSupport()); |
2151 SkASSERT(this->caps()->pathStencilingSupport()); | 2158 SkASSERT(this->caps()->pathRenderingSupport()); |
2152 SkASSERT(components >= kS_TexGenComponents && components <= kSTR_TexGenCompo
nents); | 2159 SkASSERT(components >= kS_TexGenComponents && components <= kSTR_TexGenCompo
nents); |
2153 | 2160 |
2154 if (GR_GL_OBJECT_LINEAR == fHWTexGenSettings[unitIdx].fMode && | 2161 if (GR_GL_OBJECT_LINEAR == fHWTexGenSettings[unitIdx].fMode && |
2155 components == fHWTexGenSettings[unitIdx].fNumComponents && | 2162 components == fHWTexGenSettings[unitIdx].fNumComponents && |
2156 !memcmp(coefficients, fHWTexGenSettings[unitIdx].fCoefficients, | 2163 !memcmp(coefficients, fHWTexGenSettings[unitIdx].fCoefficients, |
2157 3 * components * sizeof(GrGLfloat))) { | 2164 3 * components * sizeof(GrGLfloat))) { |
2158 return; | 2165 return; |
2159 } | 2166 } |
2160 | 2167 |
2161 this->setTextureUnit(unitIdx); | 2168 this->setTextureUnit(unitIdx); |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2715 this->setVertexArrayID(gpu, 0); | 2722 this->setVertexArrayID(gpu, 0); |
2716 } | 2723 } |
2717 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2724 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2718 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2725 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2719 fDefaultVertexArrayAttribState.resize(attrCount); | 2726 fDefaultVertexArrayAttribState.resize(attrCount); |
2720 } | 2727 } |
2721 attribState = &fDefaultVertexArrayAttribState; | 2728 attribState = &fDefaultVertexArrayAttribState; |
2722 } | 2729 } |
2723 return attribState; | 2730 return attribState; |
2724 } | 2731 } |
OLD | NEW |