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

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

Issue 737723003: drawinfo carries bufferinfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc 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/GrInOrderDrawBuffer.cpp ('k') | no next file » | 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 #include "GrGpuGL.h" 8 #include "GrGpuGL.h"
9 9
10 #include "builders/GrGLProgramBuilder.h" 10 #include "builders/GrGLProgramBuilder.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 257 }
258 258
259 void GrGpuGL::setupGeometry(const GrOptDrawState& optState, 259 void GrGpuGL::setupGeometry(const GrOptDrawState& optState,
260 const GrDrawTarget::DrawInfo& info, 260 const GrDrawTarget::DrawInfo& info,
261 size_t* indexOffsetInBytes) { 261 size_t* indexOffsetInBytes) {
262 GrGLsizei stride = static_cast<GrGLsizei>(optState.getVertexStride()); 262 GrGLsizei stride = static_cast<GrGLsizei>(optState.getVertexStride());
263 263
264 size_t vertexOffsetInBytes = stride * info.startVertex(); 264 size_t vertexOffsetInBytes = stride * info.startVertex();
265 265
266 GrGLVertexBuffer* vbuf; 266 GrGLVertexBuffer* vbuf;
267 vbuf = (GrGLVertexBuffer*) this->getGeomSrc().fVertexBuffer; 267 vbuf = (GrGLVertexBuffer*) info.vertexBuffer();
268 268
269 SkASSERT(vbuf); 269 SkASSERT(vbuf);
270 SkASSERT(!vbuf->isMapped()); 270 SkASSERT(!vbuf->isMapped());
271 vertexOffsetInBytes += vbuf->baseOffset(); 271 vertexOffsetInBytes += vbuf->baseOffset();
272 272
273 GrGLIndexBuffer* ibuf = NULL; 273 GrGLIndexBuffer* ibuf = NULL;
274 if (info.isIndexed()) { 274 if (info.isIndexed()) {
275 SkASSERT(indexOffsetInBytes); 275 SkASSERT(indexOffsetInBytes);
276 276
277 *indexOffsetInBytes = 0; 277 *indexOffsetInBytes = 0;
278 ibuf = (GrGLIndexBuffer*)this->getGeomSrc().fIndexBuffer; 278 ibuf = (GrGLIndexBuffer*)info.indexBuffer();
279 279
280 SkASSERT(ibuf); 280 SkASSERT(ibuf);
281 SkASSERT(!ibuf->isMapped()); 281 SkASSERT(!ibuf->isMapped());
282 *indexOffsetInBytes += ibuf->baseOffset(); 282 *indexOffsetInBytes += ibuf->baseOffset();
283 } 283 }
284 GrGLAttribArrayState* attribState = 284 GrGLAttribArrayState* attribState =
285 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf); 285 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf);
286 286
287 if (fCurrentProgram->hasVertexShader()) { 287 if (fCurrentProgram->hasVertexShader()) {
288 int vertexAttribCount = optState.getVertexAttribCount(); 288 int vertexAttribCount = optState.getVertexAttribCount();
(...skipping 20 matching lines...) Expand all
309 309
310 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState, 310 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState,
311 const GrProgramDesc::DescInfo& descInfo, 311 const GrProgramDesc::DescInfo& descInfo,
312 GrGpu::DrawType drawType, 312 GrGpu::DrawType drawType,
313 const GrDeviceCoordTexture* dstCopy, 313 const GrDeviceCoordTexture* dstCopy,
314 GrProgramDesc* desc) { 314 GrProgramDesc* desc) {
315 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, dstCo py, desc)) { 315 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, dstCo py, desc)) {
316 SkDEBUGFAIL("Failed to generate GL program descriptor"); 316 SkDEBUGFAIL("Failed to generate GL program descriptor");
317 } 317 }
318 } 318 }
OLDNEW
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698