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

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

Issue 1293563003: Put clear and discard into GrBatch. (Closed) Base URL: https://skia.googlesource.com/skia.git@protectedprepare
Patch Set: tiny Created 5 years, 4 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/batches/GrDiscardBatch.h ('k') | src/gpu/batches/GrVertexBatch.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 GrDrawBatch_DEFINED 8 #ifndef GrDrawBatch_DEFINED
9 #define GrDrawBatch_DEFINED 9 #define GrDrawBatch_DEFINED
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 const GrPipeline* pipeline() const { 49 const GrPipeline* pipeline() const {
50 SkASSERT(fPipelineInstalled); 50 SkASSERT(fPipelineInstalled);
51 return reinterpret_cast<const GrPipeline*>(fPipelineStorage.get()); 51 return reinterpret_cast<const GrPipeline*>(fPipelineStorage.get());
52 } 52 }
53 53
54 bool installPipeline(const GrPipeline::CreateArgs&); 54 bool installPipeline(const GrPipeline::CreateArgs&);
55 55
56 // TODO no GrPrimitiveProcessors yet read fragment position 56 // TODO no GrPrimitiveProcessors yet read fragment position
57 bool willReadFragmentPosition() const { return false; } 57 bool willReadFragmentPosition() const { return false; }
58 58
59 uint32_t renderTargetUniqueID() const final {
60 SkASSERT(fPipelineInstalled);
61 return this->pipeline()->getRenderTarget()->getUniqueID();
62 }
63
64 SkString dumpInfo() const override {
65 SkString string;
66 string.append("ColorStages:\n");
67 for (int i = 0; i < this->pipeline()->numColorFragmentStages(); i++) {
68 string.appendf("\t\t%s\n", this->pipeline()->getColorStage(i).proces sor()->name());
69 }
70 string.append("CoverageStages:\n");
71 for (int i = 0; i < this->pipeline()->numCoverageFragmentStages(); i++) {
72 string.appendf("\t%s\n", this->pipeline()->getCoverageStage(i).proce ssor()->name());
73 }
74 string.appendf("XP: %s\n", this->pipeline()->getXferProcessor()->name()) ;
75 return string;
76 }
77
59 private: 78 private:
60 /** 79 /**
61 * initBatchTracker is a hook for the some additional overrides / optimizati on possibilities 80 * initBatchTracker is a hook for the some additional overrides / optimizati on possibilities
62 * from the GrXferProcessor. 81 * from the GrXferProcessor.
63 */ 82 */
64 virtual void initBatchTracker(const GrPipelineOptimizations&) = 0; 83 virtual void initBatchTracker(const GrPipelineOptimizations&) = 0;
65 84
66 protected: 85 protected:
67 SkTArray<SkAutoTUnref<GrBatchUploader>, true> fInlineUploads; 86 SkTArray<SkAutoTUnref<GrBatchUploader>, true> fInlineUploads;
68 87
69 private: 88 private:
70 SkAlignedSTStorage<1, GrPipeline> fPipelineStorage; 89 SkAlignedSTStorage<1, GrPipeline> fPipelineStorage;
71 bool fPipelineInstalled; 90 bool fPipelineInstalled;
72 typedef GrBatch INHERITED; 91 typedef GrBatch INHERITED;
73 }; 92 };
74 93
75 #endif 94 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDiscardBatch.h ('k') | src/gpu/batches/GrVertexBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698