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

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

Issue 2078483002: Start using GrGpuCommandBuffer in GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@memoryWAR
Patch Set: remove errant lines Created 4 years, 5 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/GrBatch.h ('k') | src/gpu/batches/GrCopySurfaceBatch.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 GrClearBatch_DEFINED 8 #ifndef GrClearBatch_DEFINED
9 #define GrClearBatch_DEFINED 9 #define GrClearBatch_DEFINED
10 10
11 #include "GrBatch.h" 11 #include "GrBatch.h"
12 #include "GrBatchFlushState.h" 12 #include "GrBatchFlushState.h"
13 #include "GrGpu.h" 13 #include "GrGpu.h"
14 #include "GrGpuCommandBuffer.h"
14 #include "GrRenderTarget.h" 15 #include "GrRenderTarget.h"
15 16
16 class GrClearBatch final : public GrBatch { 17 class GrClearBatch final : public GrBatch {
17 public: 18 public:
18 DEFINE_BATCH_CLASS_ID 19 DEFINE_BATCH_CLASS_ID
19 20
20 GrClearBatch(const SkIRect& rect, GrColor color, GrRenderTarget* rt) 21 GrClearBatch(const SkIRect& rect, GrColor color, GrRenderTarget* rt)
21 : INHERITED(ClassID()) 22 : INHERITED(ClassID())
22 , fRect(rect) 23 , fRect(rect)
23 , fColor(color) 24 , fColor(color)
(...skipping 28 matching lines...) Expand all
52 return true; 53 return true;
53 } else if (cb->fColor == fColor && fRect.contains(cb->fRect)) { 54 } else if (cb->fColor == fColor && fRect.contains(cb->fRect)) {
54 return true; 55 return true;
55 } 56 }
56 return false; 57 return false;
57 } 58 }
58 59
59 void onPrepare(GrBatchFlushState*) override {} 60 void onPrepare(GrBatchFlushState*) override {}
60 61
61 void onDraw(GrBatchFlushState* state) override { 62 void onDraw(GrBatchFlushState* state) override {
62 state->gpu()->clear(fRect, fColor, fRenderTarget.get()); 63 state->commandBuffer()->clear(fRect, fColor, fRenderTarget.get());
63 } 64 }
64 65
65 SkIRect fRect; 66 SkIRect fRect;
66 GrColor fColor; 67 GrColor fColor;
67 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; 68 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
68 69
69 typedef GrBatch INHERITED; 70 typedef GrBatch INHERITED;
70 }; 71 };
71 72
72 class GrClearStencilClipBatch final : public GrBatch { 73 class GrClearStencilClipBatch final : public GrBatch {
(...skipping 20 matching lines...) Expand all
93 fRenderTarget.get()); 94 fRenderTarget.get());
94 return string; 95 return string;
95 } 96 }
96 97
97 private: 98 private:
98 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f alse; } 99 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f alse; }
99 100
100 void onPrepare(GrBatchFlushState*) override {} 101 void onPrepare(GrBatchFlushState*) override {}
101 102
102 void onDraw(GrBatchFlushState* state) override { 103 void onDraw(GrBatchFlushState* state) override {
103 state->gpu()->clearStencilClip(fRect, fInsideClip, fRenderTarget.get()); 104 state->commandBuffer()->clearStencilClip(fRect, fInsideClip, fRenderTarg et.get());
104 } 105 }
105 106
106 SkIRect fRect; 107 SkIRect fRect;
107 bool fInsideClip; 108 bool fInsideClip;
108 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; 109 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
109 110
110 typedef GrBatch INHERITED; 111 typedef GrBatch INHERITED;
111 }; 112 };
112 113
113 #endif 114 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | src/gpu/batches/GrCopySurfaceBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698