| OLD | NEW |
| 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 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 state->commandBuffer()->clear(fRect, fColor, fRenderTarget.get()); | 64 state->commandBuffer()->clear(fRect, fColor, fRenderTarget.get()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 SkIRect fRect; | 67 SkIRect fRect; |
| 68 GrColor fColor; | 68 GrColor fColor; |
| 69 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; | 69 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; |
| 70 | 70 |
| 71 typedef GrBatch INHERITED; | 71 typedef GrBatch INHERITED; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 class GrClearStencilClipBatch final : public GrBatch { | |
| 75 public: | |
| 76 DEFINE_BATCH_CLASS_ID | |
| 77 | |
| 78 GrClearStencilClipBatch(const SkIRect& rect, bool insideClip, GrRenderTarget
* rt) | |
| 79 : INHERITED(ClassID()) | |
| 80 , fRect(rect) | |
| 81 , fInsideClip(insideClip) | |
| 82 , fRenderTarget(rt) { | |
| 83 this->setBounds(SkRect::Make(rect), HasAABloat::kNo, IsZeroArea::kNo); | |
| 84 } | |
| 85 | |
| 86 const char* name() const override { return "ClearStencilClip"; } | |
| 87 | |
| 88 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()-
>getUniqueID(); } | |
| 89 GrRenderTarget* renderTarget() const override { return fRenderTarget.get();
} | |
| 90 | |
| 91 SkString dumpInfo() const override { | |
| 92 SkString string; | |
| 93 string.printf("Rect [L: %d, T: %d, R: %d, B: %d], IC: %d, RT: 0x%p", | |
| 94 fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, fIns
ideClip, | |
| 95 fRenderTarget.get()); | |
| 96 string.append(INHERITED::dumpInfo()); | |
| 97 return string; | |
| 98 } | |
| 99 | |
| 100 private: | |
| 101 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f
alse; } | |
| 102 | |
| 103 void onPrepare(GrBatchFlushState*) override {} | |
| 104 | |
| 105 void onDraw(GrBatchFlushState* state) override { | |
| 106 state->commandBuffer()->clearStencilClip(fRect, fInsideClip, fRenderTarg
et.get()); | |
| 107 } | |
| 108 | |
| 109 SkIRect fRect; | |
| 110 bool fInsideClip; | |
| 111 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; | |
| 112 | |
| 113 typedef GrBatch INHERITED; | |
| 114 }; | |
| 115 | |
| 116 #endif | 74 #endif |
| OLD | NEW |