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 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 GetWindowThreadProcessId(hwnd, &wndProcID); | 1724 GetWindowThreadProcessId(hwnd, &wndProcID); |
1725 if(wndProcID == procID) { | 1725 if(wndProcID == procID) { |
1726 SwapBuffers(GetDC(hwnd)); | 1726 SwapBuffers(GetDC(hwnd)); |
1727 } | 1727 } |
1728 hwnd = GetNextWindow(hwnd, GW_HWNDNEXT); | 1728 hwnd = GetNextWindow(hwnd, GW_HWNDNEXT); |
1729 } | 1729 } |
1730 } | 1730 } |
1731 #endif | 1731 #endif |
1732 #endif | 1732 #endif |
1733 | 1733 |
1734 void GrGpuGL::onGpuDraw(const DrawInfo& info) { | 1734 void GrGpuGL::onGpuDraw(const GrDrawTarget::DrawInfo& info) { |
1735 size_t indexOffsetInBytes; | 1735 size_t indexOffsetInBytes; |
1736 this->setupGeometry(info, &indexOffsetInBytes); | 1736 this->setupGeometry(info, &indexOffsetInBytes); |
1737 | 1737 |
1738 SkASSERT((size_t)info.primitiveType() < SK_ARRAY_COUNT(gPrimitiveType2GLMode
)); | 1738 SkASSERT((size_t)info.primitiveType() < SK_ARRAY_COUNT(gPrimitiveType2GLMode
)); |
1739 | 1739 |
1740 if (info.isIndexed()) { | 1740 if (info.isIndexed()) { |
1741 GrGLvoid* indices = | 1741 GrGLvoid* indices = |
1742 reinterpret_cast<GrGLvoid*>(indexOffsetInBytes + sizeof(uint16_t) *
info.startIndex()); | 1742 reinterpret_cast<GrGLvoid*>(indexOffsetInBytes + sizeof(uint16_t) *
info.startIndex()); |
1743 // info.startVertex() was accounted for by setupGeometry. | 1743 // info.startVertex() was accounted for by setupGeometry. |
1744 GL_CALL(DrawElements(gPrimitiveType2GLMode[info.primitiveType()], | 1744 GL_CALL(DrawElements(gPrimitiveType2GLMode[info.primitiveType()], |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2556 this->setVertexArrayID(gpu, 0); | 2556 this->setVertexArrayID(gpu, 0); |
2557 } | 2557 } |
2558 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2558 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2559 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2559 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2560 fDefaultVertexArrayAttribState.resize(attrCount); | 2560 fDefaultVertexArrayAttribState.resize(attrCount); |
2561 } | 2561 } |
2562 attribState = &fDefaultVertexArrayAttribState; | 2562 attribState = &fDefaultVertexArrayAttribState; |
2563 } | 2563 } |
2564 return attribState; | 2564 return attribState; |
2565 } | 2565 } |
OLD | NEW |