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 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 fScissorState.fEnabled = true; | 1344 fScissorState.fEnabled = true; |
1345 fScissorState.fRect = rect; | 1345 fScissorState.fRect = rect; |
1346 this->flushScissor(); | 1346 this->flushScissor(); |
1347 | 1347 |
1348 GL_CALL(StencilMask((uint32_t) clipStencilMask)); | 1348 GL_CALL(StencilMask((uint32_t) clipStencilMask)); |
1349 GL_CALL(ClearStencil(value)); | 1349 GL_CALL(ClearStencil(value)); |
1350 GL_CALL(Clear(GR_GL_STENCIL_BUFFER_BIT)); | 1350 GL_CALL(Clear(GR_GL_STENCIL_BUFFER_BIT)); |
1351 fHWStencilSettings.invalidate(); | 1351 fHWStencilSettings.invalidate(); |
1352 } | 1352 } |
1353 | 1353 |
1354 void GrGpuGL::onForceRenderTargetFlush() { | |
1355 this->flushRenderTarget(&SkIRect::EmptyIRect()); | |
1356 } | |
1357 | |
1358 bool GrGpuGL::readPixelsWillPayForYFlip(GrRenderTarget* renderTarget, | 1354 bool GrGpuGL::readPixelsWillPayForYFlip(GrRenderTarget* renderTarget, |
1359 int left, int top, | 1355 int left, int top, |
1360 int width, int height, | 1356 int width, int height, |
1361 GrPixelConfig config, | 1357 GrPixelConfig config, |
1362 size_t rowBytes) const { | 1358 size_t rowBytes) const { |
1363 // If this rendertarget is aready TopLeft, we don't need to flip. | 1359 // If this rendertarget is aready TopLeft, we don't need to flip. |
1364 if (kTopLeft_GrSurfaceOrigin == renderTarget->origin()) { | 1360 if (kTopLeft_GrSurfaceOrigin == renderTarget->origin()) { |
1365 return false; | 1361 return false; |
1366 } | 1362 } |
1367 | 1363 |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 this->setVertexArrayID(gpu, 0); | 2789 this->setVertexArrayID(gpu, 0); |
2794 } | 2790 } |
2795 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2791 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2796 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2792 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2797 fDefaultVertexArrayAttribState.resize(attrCount); | 2793 fDefaultVertexArrayAttribState.resize(attrCount); |
2798 } | 2794 } |
2799 attribState = &fDefaultVertexArrayAttribState; | 2795 attribState = &fDefaultVertexArrayAttribState; |
2800 } | 2796 } |
2801 return attribState; | 2797 return attribState; |
2802 } | 2798 } |
OLD | NEW |