Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: src/gpu/gl/GrGpuGL.cpp

Issue 709133003: Snap optdrawstate in inorder draw buffer and pass into gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@remove_friends
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698