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 1711 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::onDraw(const GrDrawTarget::DrawInfo& info) { | 1732 void GrGpuGL::onDraw(const GrOptDrawState& ds, const GrDrawTarget::DrawInfo& inf
o) { |
1733 size_t indexOffsetInBytes; | 1733 size_t indexOffsetInBytes; |
1734 this->setupGeometry(info, &indexOffsetInBytes); | 1734 this->setupGeometry(ds, 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()], |
1743 info.indexCount(), | 1743 info.indexCount(), |
1744 GR_GL_UNSIGNED_SHORT, | 1744 GR_GL_UNSIGNED_SHORT, |
(...skipping 809 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 |