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

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

Issue 1888473002: Use transfer buffer for BatchAtlas texture copies Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Chrome 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
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 upload(wp); 80 GrDrawBatch::TransferPixelsFn tp = [this](GrSurface* surface,
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(surface, left, top, width, height, config, buffer,
85 offset, rowBytes);
86 };
87 upload(wp, tp);
81 } 88 }
82 89
83 void putBackIndices(size_t indices) { fIndexPool.putBack(indices * sizeof(ui nt16_t)); } 90 void putBackIndices(size_t indices) { fIndexPool.putBack(indices * sizeof(ui nt16_t)); }
84 91
85 void putBackVertexSpace(size_t sizeInBytes) { fVertexPool.putBack(sizeInByte s); } 92 void putBackVertexSpace(size_t sizeInBytes) { fVertexPool.putBack(sizeInByte s); }
86 93
87 GrGpu* gpu() { return fGpu; } 94 GrGpu* gpu() { return fGpu; }
88 95
89 void reset() { 96 void reset() {
90 fVertexPool.reset(); 97 fVertexPool.reset();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 void putBackVertices(int vertices, size_t vertexStride) { 202 void putBackVertices(int vertices, size_t vertexStride) {
196 this->state()->putBackVertexSpace(vertices * vertexStride); 203 this->state()->putBackVertexSpace(vertices * vertexStride);
197 } 204 }
198 205
199 private: 206 private:
200 GrVertexBatch* vertexBatch() { return static_cast<GrVertexBatch*>(this->batc h()); } 207 GrVertexBatch* vertexBatch() { return static_cast<GrVertexBatch*>(this->batc h()); }
201 typedef GrDrawBatch::Target INHERITED; 208 typedef GrDrawBatch::Target INHERITED;
202 }; 209 };
203 210
204 #endif 211 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698