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

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

Issue 2145643003: Move GrDrawTarget::clear logic into GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix typo 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/GrClearBatch.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrClearStencilClipBatch_DEFINED
9 #define GrClearStencilClipBatch_DEFINED
10
11 #include "GrBatch.h"
12 #include "GrBatchFlushState.h"
13 #include "GrGpu.h"
14 #include "GrGpuCommandBuffer.h"
15 #include "GrRenderTarget.h"
16
17 class GrClearStencilClipBatch final : public GrBatch {
18 public:
19 DEFINE_BATCH_CLASS_ID
20
21 GrClearStencilClipBatch(const SkIRect& rect, bool insideClip, GrRenderTarget * rt)
22 : INHERITED(ClassID())
23 , fRect(rect)
24 , fInsideClip(insideClip)
25 , fRenderTarget(rt) {
26 this->setBounds(SkRect::Make(rect), HasAABloat::kNo, IsZeroArea::kNo);
27 }
28
29 const char* name() const override { return "ClearStencilClip"; }
30
31 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()- >getUniqueID(); }
32 GrRenderTarget* renderTarget() const override { return fRenderTarget.get(); }
33
34 SkString dumpInfo() const override {
35 SkString string;
36 string.printf("Rect [L: %d, T: %d, R: %d, B: %d], IC: %d, RT: %d",
37 fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, fIns ideClip,
38 fRenderTarget.get()->getUniqueID());
39 string.append(INHERITED::dumpInfo());
40 return string;
41 }
42
43 private:
44 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f alse; }
45
46 void onPrepare(GrBatchFlushState*) override {}
47
48 void onDraw(GrBatchFlushState* state) override {
49 state->commandBuffer()->clearStencilClip(fRect, fInsideClip, fRenderTarg et.get());
50 }
51
52 SkIRect fRect;
53 bool fInsideClip;
54 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
55
56 typedef GrBatch INHERITED;
57 };
58
59 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrClearBatch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698