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 "GrGLStencilAttachment.h" | 10 #include "GrGLStencilAttachment.h" |
(...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 int set_a_break_pt_here = 9; | 1944 int set_a_break_pt_here = 9; |
1945 aglSwapBuffers(aglGetCurrentContext()); | 1945 aglSwapBuffers(aglGetCurrentContext()); |
1946 #elif defined(SK_BUILD_FOR_WIN32) | 1946 #elif defined(SK_BUILD_FOR_WIN32) |
1947 SwapBuf(); | 1947 SwapBuf(); |
1948 int set_a_break_pt_here = 9; | 1948 int set_a_break_pt_here = 9; |
1949 SwapBuf(); | 1949 SwapBuf(); |
1950 #endif | 1950 #endif |
1951 #endif | 1951 #endif |
1952 } | 1952 } |
1953 | 1953 |
1954 void GrGLGpu::onStencilPath(const GrPath* path, const StencilPathState& state) { | |
1955 this->flushColorWrite(false); | |
1956 this->flushDrawFace(GrPipelineBuilder::kBoth_DrawFace); | |
1957 | |
1958 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(state.fRenderTarget); | |
1959 SkISize size = SkISize::Make(rt->width(), rt->height()); | |
1960 this->glPathRendering()->setProjectionMatrix(*state.fViewMatrix, size, rt->o
rigin()); | |
1961 this->flushScissor(*state.fScissor, rt->getViewport(), rt->origin()); | |
1962 this->flushHWAAState(rt, state.fUseHWAA); | |
1963 this->flushRenderTarget(rt, NULL); | |
1964 | |
1965 fPathRendering->stencilPath(path, *state.fStencil); | |
1966 } | |
1967 | |
1968 void GrGLGpu::onDrawPath(const DrawArgs& args, const GrPath* path, | |
1969 const GrStencilSettings& stencil) { | |
1970 if (!this->flushGLState(args)) { | |
1971 return; | |
1972 } | |
1973 fPathRendering->drawPath(path, stencil); | |
1974 } | |
1975 | |
1976 void GrGLGpu::onDrawPaths(const DrawArgs& args, | |
1977 const GrPathRange* pathRange, | |
1978 const void* indices, | |
1979 GrDrawTarget::PathIndexType indexType, | |
1980 const float transformValues[], | |
1981 GrDrawTarget::PathTransformType transformType, | |
1982 int count, | |
1983 const GrStencilSettings& stencil) { | |
1984 if (!this->flushGLState(args)) { | |
1985 return; | |
1986 } | |
1987 fPathRendering->drawPaths(pathRange, indices, indexType, transformValues, | |
1988 transformType, count, stencil); | |
1989 } | |
1990 | |
1991 void GrGLGpu::onResolveRenderTarget(GrRenderTarget* target) { | 1954 void GrGLGpu::onResolveRenderTarget(GrRenderTarget* target) { |
1992 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(target); | 1955 GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(target); |
1993 if (rt->needsResolve()) { | 1956 if (rt->needsResolve()) { |
1994 // Some extensions automatically resolves the texture when it is read. | 1957 // Some extensions automatically resolves the texture when it is read. |
1995 if (this->glCaps().usesMSAARenderBuffers()) { | 1958 if (this->glCaps().usesMSAARenderBuffers()) { |
1996 SkASSERT(rt->textureFBOID() != rt->renderFBOID()); | 1959 SkASSERT(rt->textureFBOID() != rt->renderFBOID()); |
1997 fStats.incRenderTargetBinds(); | 1960 fStats.incRenderTargetBinds(); |
1998 fStats.incRenderTargetBinds(); | 1961 fStats.incRenderTargetBinds(); |
1999 GL_CALL(BindFramebuffer(GR_GL_READ_FRAMEBUFFER, rt->renderFBOID())); | 1962 GL_CALL(BindFramebuffer(GR_GL_READ_FRAMEBUFFER, rt->renderFBOID())); |
2000 GL_CALL(BindFramebuffer(GR_GL_DRAW_FRAMEBUFFER, rt->textureFBOID()))
; | 1963 GL_CALL(BindFramebuffer(GR_GL_DRAW_FRAMEBUFFER, rt->textureFBOID()))
; |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2891 this->setVertexArrayID(gpu, 0); | 2854 this->setVertexArrayID(gpu, 0); |
2892 } | 2855 } |
2893 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2856 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2894 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2857 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2895 fDefaultVertexArrayAttribState.resize(attrCount); | 2858 fDefaultVertexArrayAttribState.resize(attrCount); |
2896 } | 2859 } |
2897 attribState = &fDefaultVertexArrayAttribState; | 2860 attribState = &fDefaultVertexArrayAttribState; |
2898 } | 2861 } |
2899 return attribState; | 2862 return attribState; |
2900 } | 2863 } |
OLD | NEW |