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

Unified Diff: src/gpu/batches/GrClearBatch.h

Issue 2215323003: Start using RenderTargetProxy (omnibus) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | src/gpu/batches/GrClearStencilClipBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrClearBatch.h
diff --git a/src/gpu/batches/GrClearBatch.h b/src/gpu/batches/GrClearBatch.h
index f11d485536ff37f2282ef405454cdb3689f10317..2c1c0253c6bd644b767a6f8250e28aa5178ff05e 100644
--- a/src/gpu/batches/GrClearBatch.h
+++ b/src/gpu/batches/GrClearBatch.h
@@ -19,9 +19,9 @@ class GrClearBatch final : public GrBatch {
public:
DEFINE_BATCH_CLASS_ID
- static sk_sp<GrClearBatch> Make(const GrFixedClip& clip, GrColor color, GrRenderTarget* rt) {
- sk_sp<GrClearBatch> batch(new GrClearBatch(clip, color, rt));
- if (!batch->renderTarget()) {
+ static sk_sp<GrClearBatch> Make(const GrFixedClip& clip, GrColor color, GrRenderTargetProxy* rtp) {
+ sk_sp<GrClearBatch> batch(new GrClearBatch(clip, color, rtp));
+ if (!batch->rtp()) {
return nullptr; // The clip did not contain any pixels within the render target.
}
return batch;
@@ -29,8 +29,8 @@ public:
const char* name() const override { return "Clear"; }
- uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()->uniqueID(); }
- GrRenderTarget* renderTarget() const override { return fRenderTarget.get(); }
+ uint32_t renderTargetUniqueID() const override { return fRenderTargetProxy.get()->uniqueID(); }
+ GrRenderTargetProxy* rtp() const override { return fRenderTargetProxy.get(); }
SkString dumpInfo() const override {
SkString string("Scissor [");
@@ -38,7 +38,7 @@ public:
const SkIRect& r = fClip.scissorRect();
string.appendf("L: %d, T: %d, R: %d, B: %d", r.fLeft, r.fTop, r.fRight, r.fBottom);
}
- string.appendf("], Color: 0x%08x, RT: %d", fColor, fRenderTarget.get()->uniqueID());
+ string.appendf("], Color: 0x%08x, RT: %d", fColor, fRenderTargetProxy.get()->uniqueID());
string.append(INHERITED::dumpInfo());
return string;
}
@@ -46,11 +46,11 @@ public:
void setColor(GrColor color) { fColor = color; }
private:
- GrClearBatch(const GrFixedClip& clip, GrColor color, GrRenderTarget* rt)
+ GrClearBatch(const GrFixedClip& clip, GrColor color, GrRenderTargetProxy* rtp)
: INHERITED(ClassID())
, fClip(clip)
, fColor(color) {
- SkIRect rtRect = SkIRect::MakeWH(rt->width(), rt->height());
+ SkIRect rtRect = SkIRect::MakeWH(rtp->width(), rtp->height());
if (fClip.scissorEnabled()) {
// Don't let scissors extend outside the RT. This may improve batching.
if (!fClip.intersect(rtRect)) {
@@ -62,7 +62,7 @@ private:
}
this->setBounds(SkRect::Make(fClip.scissorEnabled() ? fClip.scissorRect() : rtRect),
HasAABloat::kNo, IsZeroArea::kNo);
- fRenderTarget.reset(rt);
+ fRenderTargetProxy.reset(rtp);
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
@@ -70,7 +70,7 @@ private:
// contains the old clear, or when the new clear is a subset of the old clear and is the
// same color.
GrClearBatch* cb = t->cast<GrClearBatch>();
- SkASSERT(cb->fRenderTarget == fRenderTarget);
+ SkASSERT(cb->fRenderTargetProxy == fRenderTargetProxy);
if (!fClip.windowRectsState().cheapEqualTo(cb->fClip.windowRectsState())) {
return false;
}
@@ -100,7 +100,7 @@ private:
GrFixedClip fClip;
GrColor fColor;
- GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
+ GrPendingIOResource<GrRenderTargetProxy, kWrite_GrIOType> fRenderTargetProxy;
typedef GrBatch INHERITED;
};
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | src/gpu/batches/GrClearStencilClipBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698