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

Side by Side Diff: src/gpu/batches/GrTessellatingPathRenderer.cpp

Issue 1854283004: Track GL buffer state based on unique resource ID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for GR_GL_USE_BUFFER_DATA_NULL_HINT=0 Created 4 years, 8 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/GrResourceProvider.cpp ('k') | src/gpu/gl/GrGLBuffer.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 "GrTessellatingPathRenderer.h" 8 #include "GrTessellatingPathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 class StaticVertexAllocator : public GrTessellator::VertexAllocator { 62 class StaticVertexAllocator : public GrTessellator::VertexAllocator {
63 public: 63 public:
64 StaticVertexAllocator(GrResourceProvider* resourceProvider, bool canMapVB) 64 StaticVertexAllocator(GrResourceProvider* resourceProvider, bool canMapVB)
65 : fResourceProvider(resourceProvider) 65 : fResourceProvider(resourceProvider)
66 , fCanMapVB(canMapVB) 66 , fCanMapVB(canMapVB)
67 , fVertices(nullptr) { 67 , fVertices(nullptr) {
68 } 68 }
69 SkPoint* lock(int vertexCount) override { 69 SkPoint* lock(int vertexCount) override {
70 size_t size = vertexCount * sizeof(SkPoint); 70 size_t size = vertexCount * sizeof(SkPoint);
71 fVertexBuffer.reset(fResourceProvider->createBuffer( 71 fVertexBuffer.reset(fResourceProvider->createBuffer(
72 kVertex_GrBufferType, size, kStatic_GrAccessPattern, 0)); 72 size, kVertex_GrBufferType, kStatic_GrAccessPattern, 0));
73 if (!fVertexBuffer.get()) { 73 if (!fVertexBuffer.get()) {
74 return nullptr; 74 return nullptr;
75 } 75 }
76 if (fCanMapVB) { 76 if (fCanMapVB) {
77 fVertices = static_cast<SkPoint*>(fVertexBuffer->map()); 77 fVertices = static_cast<SkPoint*>(fVertexBuffer->map());
78 } else { 78 } else {
79 fVertices = new SkPoint[vertexCount]; 79 fVertices = new SkPoint[vertexCount];
80 } 80 }
81 return fVertices; 81 return fVertices;
82 } 82 }
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 bool result = viewMatrix.invert(&vmi); 319 bool result = viewMatrix.invert(&vmi);
320 if (!result) { 320 if (!result) {
321 SkFAIL("Cannot invert matrix\n"); 321 SkFAIL("Cannot invert matrix\n");
322 } 322 }
323 vmi.mapRect(&clipBounds); 323 vmi.mapRect(&clipBounds);
324 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random); 324 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random);
325 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl ipBounds); 325 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl ipBounds);
326 } 326 }
327 327
328 #endif 328 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrResourceProvider.cpp ('k') | src/gpu/gl/GrGLBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698