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

Side by Side Diff: src/gpu/GrBatchFlushState.h

Issue 1904723003: Revert of Use transfer buffer for BatchAtlas texture copies (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrBatchAtlas.cpp ('k') | src/gpu/GrGpu.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 #ifndef GrBatchBuffer_DEFINED 8 #ifndef GrBatchBuffer_DEFINED
9 #define GrBatchBuffer_DEFINED 9 #define GrBatchBuffer_DEFINED
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 void doUpload(GrDrawBatch::DeferredUploadFn& upload) { 72 void doUpload(GrDrawBatch::DeferredUploadFn& upload) {
73 GrDrawBatch::WritePixelsFn wp = [this] (GrSurface* surface, 73 GrDrawBatch::WritePixelsFn wp = [this] (GrSurface* surface,
74 int left, int top, int width, int height, 74 int left, int top, int width, int height,
75 GrPixelConfig config, const void* buffer, 75 GrPixelConfig config, const void* buffer,
76 size_t rowBytes) -> bool { 76 size_t rowBytes) -> bool {
77 return this->fGpu->writePixels(surface, left, top, width, height, co nfig, buffer, 77 return this->fGpu->writePixels(surface, left, top, width, height, co nfig, buffer,
78 rowBytes); 78 rowBytes);
79 }; 79 };
80 GrDrawBatch::TransferPixelsFn tp = [this](GrTexture* texture, 80 upload(wp);
81 int left, int top, int width, in t height,
82 GrPixelConfig config, GrBuffer* buffer,
83 size_t offset, size_t rowBytes) -> bool {
84 return this->fGpu->transferPixels(texture, left, top, width, height, config, buffer,
85 offset, rowBytes);
86 };
87 upload(wp, tp);
88 } 81 }
89 82
90 void putBackIndices(size_t indices) { fIndexPool.putBack(indices * sizeof(ui nt16_t)); } 83 void putBackIndices(size_t indices) { fIndexPool.putBack(indices * sizeof(ui nt16_t)); }
91 84
92 void putBackVertexSpace(size_t sizeInBytes) { fVertexPool.putBack(sizeInByte s); } 85 void putBackVertexSpace(size_t sizeInBytes) { fVertexPool.putBack(sizeInByte s); }
93 86
94 GrGpu* gpu() { return fGpu; } 87 GrGpu* gpu() { return fGpu; }
95 88
96 void reset() { 89 void reset() {
97 fVertexPool.reset(); 90 fVertexPool.reset();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void putBackVertices(int vertices, size_t vertexStride) { 195 void putBackVertices(int vertices, size_t vertexStride) {
203 this->state()->putBackVertexSpace(vertices * vertexStride); 196 this->state()->putBackVertexSpace(vertices * vertexStride);
204 } 197 }
205 198
206 private: 199 private:
207 GrVertexBatch* vertexBatch() { return static_cast<GrVertexBatch*>(this->batc h()); } 200 GrVertexBatch* vertexBatch() { return static_cast<GrVertexBatch*>(this->batc h()); }
208 typedef GrDrawBatch::Target INHERITED; 201 typedef GrDrawBatch::Target INHERITED;
209 }; 202 };
210 203
211 #endif 204 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrBatchAtlas.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698