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

Side by Side Diff: src/gpu/gl/GrGLGpu.h

Issue 2143333002: Add resource provider flag to avoid client-side buffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add resource provider flag to avoid client-side buffers Created 4 years, 5 months 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/GrGLCaps.cpp ('k') | src/gpu/gl/GrGLGpu.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 #ifndef GrGLGpu_DEFINED 8 #ifndef GrGLGpu_DEFINED
9 #define GrGLGpu_DEFINED 9 #define GrGLGpu_DEFINED
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // These callbacks update state tracking when GL objects are deleted. They a re called from 85 // These callbacks update state tracking when GL objects are deleted. They a re called from
86 // GrGLResource onRelease functions. 86 // GrGLResource onRelease functions.
87 void notifyVertexArrayDelete(GrGLuint id) { 87 void notifyVertexArrayDelete(GrGLuint id) {
88 fHWVertexArrayState.notifyVertexArrayDelete(id); 88 fHWVertexArrayState.notifyVertexArrayDelete(id);
89 } 89 }
90 90
91 // Binds a buffer to the GL target corresponding to 'type', updates internal state tracking, and 91 // Binds a buffer to the GL target corresponding to 'type', updates internal state tracking, and
92 // returns the GL target the buffer was bound to. 92 // returns the GL target the buffer was bound to.
93 // When 'type' is kIndex_GrBufferType, this function will also implicitly bi nd the default VAO. 93 // When 'type' is kIndex_GrBufferType, this function will also implicitly bi nd the default VAO.
94 // If the caller wishes to bind an index buffer to a specific VAO, it can ca ll glBind directly. 94 // If the caller wishes to bind an index buffer to a specific VAO, it can ca ll glBind directly.
95 GrGLenum bindBuffer(GrBufferType type, const GrGLBuffer*); 95 GrGLenum bindBuffer(GrBufferType type, const GrBuffer*);
96 96
97 // Called by GrGLBuffer after its buffer object has been destroyed. 97 // Called by GrGLBuffer after its buffer object has been destroyed.
98 void notifyBufferReleased(const GrGLBuffer*); 98 void notifyBufferReleased(const GrGLBuffer*);
99 99
100 // The GrGLGpuCommandBuffer does not buffer up draws before submitting them to the gpu. 100 // The GrGLGpuCommandBuffer does not buffer up draws before submitting them to the gpu.
101 // Thus this is the implementation of the draw call for the corresponding pa ssthrough function 101 // Thus this is the implementation of the draw call for the corresponding pa ssthrough function
102 // on GrGLGpuCommandBuffer. 102 // on GrGLGpuCommandBuffer.
103 void draw(const GrPipeline&, 103 void draw(const GrPipeline&,
104 const GrPrimitiveProcessor&, 104 const GrPrimitiveProcessor&,
105 const GrMesh*, 105 const GrMesh*,
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 /** 460 /**
461 * Binds the vertex array that should be used for internal draws, and re turns its attrib 461 * Binds the vertex array that should be used for internal draws, and re turns its attrib
462 * state. This binds the default VAO (ID=zero) unless we are on a core p rofile, in which 462 * state. This binds the default VAO (ID=zero) unless we are on a core p rofile, in which
463 * case we use a dummy array instead. 463 * case we use a dummy array instead.
464 * 464 *
465 * If an index buffer is privided, it will be bound to the vertex array. Otherwise the 465 * If an index buffer is privided, it will be bound to the vertex array. Otherwise the
466 * index buffer binding will be left unchanged. 466 * index buffer binding will be left unchanged.
467 * 467 *
468 * The returned GrGLAttribArrayState should be used to set vertex attrib ute arrays. 468 * The returned GrGLAttribArrayState should be used to set vertex attrib ute arrays.
469 */ 469 */
470 GrGLAttribArrayState* bindInternalVertexArray(GrGLGpu*, const GrGLBuffer * ibuff = nullptr); 470 GrGLAttribArrayState* bindInternalVertexArray(GrGLGpu*, const GrBuffer* ibuff = nullptr);
471 471
472 private: 472 private:
473 GrGLuint fBoundVertexArrayID; 473 GrGLuint fBoundVertexArrayID;
474 bool fBoundVertexArrayIDIsValid; 474 bool fBoundVertexArrayIDIsValid;
475 475
476 // We return a non-const pointer to this from bindArrayAndBuffersToDraw when vertex array 0 476 // We return a non-const pointer to this from bindArrayAndBuffersToDraw when vertex array 0
477 // is bound. However, this class is internal to GrGLGpu and this object never leaks out of 477 // is bound. However, this class is internal to GrGLGpu and this object never leaks out of
478 // GrGLGpu. 478 // GrGLGpu.
479 GrGLAttribArrayState fDefaultVertexArrayAttribState; 479 GrGLAttribArrayState fDefaultVertexArrayAttribState;
480 480
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 bool fPLSHasBeenUsed; 596 bool fPLSHasBeenUsed;
597 597
598 float fHWMinSampleShading; 598 float fHWMinSampleShading;
599 599
600 typedef GrGpu INHERITED; 600 typedef GrGpu INHERITED;
601 friend class GrGLPathRendering; // For accessing setTextureUnit. 601 friend class GrGLPathRendering; // For accessing setTextureUnit.
602 friend class gr_instanced::GLInstancedRendering; // For accessing flushGLSta te. 602 friend class gr_instanced::GLInstancedRendering; // For accessing flushGLSta te.
603 }; 603 };
604 604
605 #endif 605 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCaps.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698