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

Side by Side Diff: src/gpu/batches/GrDrawBatch.h

Issue 1888473002: Use transfer buffer for BatchAtlas texture copies Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase to ToT Created 4 years, 2 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/GrGLAssembleInterface.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 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 GrDrawBatch_DEFINED 8 #ifndef GrDrawBatch_DEFINED
9 #define GrDrawBatch_DEFINED 9 #define GrDrawBatch_DEFINED
10 10
(...skipping 28 matching lines...) Expand all
39 explicit GrBatchDrawToken(uint64_t sequenceNumber) : fSequenceNumber(sequenc eNumber) {} 39 explicit GrBatchDrawToken(uint64_t sequenceNumber) : fSequenceNumber(sequenc eNumber) {}
40 friend class GrBatchFlushState; 40 friend class GrBatchFlushState;
41 uint64_t fSequenceNumber; 41 uint64_t fSequenceNumber;
42 }; 42 };
43 43
44 /** 44 /**
45 * Base class for GrBatches that draw. These batches have a GrPipeline installed by GrDrawTarget. 45 * Base class for GrBatches that draw. These batches have a GrPipeline installed by GrDrawTarget.
46 */ 46 */
47 class GrDrawBatch : public GrBatch { 47 class GrDrawBatch : public GrBatch {
48 public: 48 public:
49 /** Method that performs an upload on behalf of a DeferredUploadFn. */ 49 /** Method that performs a texture write on behalf of a DeferredUploadFn. */
50 using WritePixelsFn = std::function<bool(GrSurface* texture, 50 using WritePixelsFn = std::function<bool(GrSurface* texture,
51 int left, int top, int width, int h eight, 51 int left, int top, int width, int h eight,
52 GrPixelConfig config, const void* b uffer, 52 GrPixelConfig config, const void* b uffer,
53 size_t rowBytes)>; 53 size_t rowBytes)>;
54 using TransferPixelsFn = std::function<bool(GrTexture* texture,
55 int left, int top, int width, in t height,
56 GrPixelConfig config, GrBuffer* buffer,
57 size_t offset, size_t rowBytes,
58 GrFence* fence)>;
54 /** See comments before GrDrawBatch::Target definition on how deferred uploa ders work. */ 59 /** See comments before GrDrawBatch::Target definition on how deferred uploa ders work. */
55 using DeferredUploadFn = std::function<void(WritePixelsFn&)>; 60 using DeferredUploadFn = std::function<void(WritePixelsFn&, TransferPixelsFn &)>;
56 61
57 class Target; 62 class Target;
58 63
59 GrDrawBatch(uint32_t classID); 64 GrDrawBatch(uint32_t classID);
60 ~GrDrawBatch() override; 65 ~GrDrawBatch() override;
61 66
62 /** 67 /**
63 * Fills in a structure informing the XP of overrides to its normal behavior . 68 * Fills in a structure informing the XP of overrides to its normal behavior .
64 */ 69 */
65 void getPipelineOptimizations(GrPipelineOptimizations* override) const; 70 void getPipelineOptimizations(GrPipelineOptimizations* override) const;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 }; 144 };
140 SkTArray<QueuedUpload> fInlineUploads; 145 SkTArray<QueuedUpload> fInlineUploads;
141 146
142 private: 147 private:
143 SkAlignedSTStorage<1, GrPipeline> fPipelineStorage; 148 SkAlignedSTStorage<1, GrPipeline> fPipelineStorage;
144 bool fPipelineInstalled; 149 bool fPipelineInstalled;
145 typedef GrBatch INHERITED; 150 typedef GrBatch INHERITED;
146 }; 151 };
147 152
148 #endif 153 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrResourceProvider.cpp ('k') | src/gpu/gl/GrGLAssembleInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698