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

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

Issue 705593002: Refactor DrawTarget and GPU to be independent (Closed) Base URL: https://skia.googlesource.com/skia.git@early_clip
Patch Set: rebase on master 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 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
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