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 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 } | 1347 } |
1348 | 1348 |
1349 void GrGpuGL::disableScissor() { | 1349 void GrGpuGL::disableScissor() { |
1350 if (kNo_TriState != fHWScissorSettings.fEnabled) { | 1350 if (kNo_TriState != fHWScissorSettings.fEnabled) { |
1351 GL_CALL(Disable(GR_GL_SCISSOR_TEST)); | 1351 GL_CALL(Disable(GR_GL_SCISSOR_TEST)); |
1352 fHWScissorSettings.fEnabled = kNo_TriState; | 1352 fHWScissorSettings.fEnabled = kNo_TriState; |
1353 return; | 1353 return; |
1354 } | 1354 } |
1355 } | 1355 } |
1356 | 1356 |
1357 void GrGpuGL::onGpuClear(GrRenderTarget* target, const SkIRect* rect, GrColor co
lor, | 1357 void GrGpuGL::onClear(GrRenderTarget* target, const SkIRect* rect, GrColor color
, |
1358 bool canIgnoreRect) { | 1358 bool canIgnoreRect) { |
1359 // parent class should never let us get here with no RT | 1359 // parent class should never let us get here with no RT |
1360 SkASSERT(target); | 1360 SkASSERT(target); |
1361 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target); | 1361 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target); |
1362 | 1362 |
1363 if (canIgnoreRect && this->glCaps().fullClearIsFree()) { | 1363 if (canIgnoreRect && this->glCaps().fullClearIsFree()) { |
1364 rect = NULL; | 1364 rect = NULL; |
1365 } | 1365 } |
1366 | 1366 |
1367 SkIRect clippedRect; | 1367 SkIRect clippedRect; |
1368 if (rect) { | 1368 if (rect) { |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 GetWindowThreadProcessId(hwnd, &wndProcID); | 1722 GetWindowThreadProcessId(hwnd, &wndProcID); |
1723 if(wndProcID == procID) { | 1723 if(wndProcID == procID) { |
1724 SwapBuffers(GetDC(hwnd)); | 1724 SwapBuffers(GetDC(hwnd)); |
1725 } | 1725 } |
1726 hwnd = GetNextWindow(hwnd, GW_HWNDNEXT); | 1726 hwnd = GetNextWindow(hwnd, GW_HWNDNEXT); |
1727 } | 1727 } |
1728 } | 1728 } |
1729 #endif | 1729 #endif |
1730 #endif | 1730 #endif |
1731 | 1731 |
1732 void GrGpuGL::onGpuDraw(const GrDrawTarget::DrawInfo& info) { | 1732 void GrGpuGL::onDraw(const GrDrawTarget::DrawInfo& info) { |
1733 size_t indexOffsetInBytes; | 1733 size_t indexOffsetInBytes; |
1734 this->setupGeometry(info, &indexOffsetInBytes); | 1734 this->setupGeometry(info, &indexOffsetInBytes); |
1735 | 1735 |
1736 SkASSERT((size_t)info.primitiveType() < SK_ARRAY_COUNT(gPrimitiveType2GLMode
)); | 1736 SkASSERT((size_t)info.primitiveType() < SK_ARRAY_COUNT(gPrimitiveType2GLMode
)); |
1737 | 1737 |
1738 if (info.isIndexed()) { | 1738 if (info.isIndexed()) { |
1739 GrGLvoid* indices = | 1739 GrGLvoid* indices = |
1740 reinterpret_cast<GrGLvoid*>(indexOffsetInBytes + sizeof(uint16_t) *
info.startIndex()); | 1740 reinterpret_cast<GrGLvoid*>(indexOffsetInBytes + sizeof(uint16_t) *
info.startIndex()); |
1741 // info.startVertex() was accounted for by setupGeometry. | 1741 // info.startVertex() was accounted for by setupGeometry. |
1742 GL_CALL(DrawElements(gPrimitiveType2GLMode[info.primitiveType()], | 1742 GL_CALL(DrawElements(gPrimitiveType2GLMode[info.primitiveType()], |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2554 this->setVertexArrayID(gpu, 0); | 2554 this->setVertexArrayID(gpu, 0); |
2555 } | 2555 } |
2556 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2556 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2557 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2557 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2558 fDefaultVertexArrayAttribState.resize(attrCount); | 2558 fDefaultVertexArrayAttribState.resize(attrCount); |
2559 } | 2559 } |
2560 attribState = &fDefaultVertexArrayAttribState; | 2560 attribState = &fDefaultVertexArrayAttribState; |
2561 } | 2561 } |
2562 return attribState; | 2562 return attribState; |
2563 } | 2563 } |
OLD | NEW |