| 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 11 matching lines...) Expand all Loading... |
| 22 static sk_sp<GrClearBatch> Make(const GrFixedClip& clip, GrColor color, GrRe
nderTarget* rt) { | 22 static sk_sp<GrClearBatch> Make(const GrFixedClip& clip, GrColor color, GrRe
nderTarget* rt) { |
| 23 sk_sp<GrClearBatch> batch(new GrClearBatch(clip, color, rt)); | 23 sk_sp<GrClearBatch> batch(new GrClearBatch(clip, color, rt)); |
| 24 if (!batch->renderTarget()) { | 24 if (!batch->renderTarget()) { |
| 25 return nullptr; // The clip did not contain any pixels within the re
nder target. | 25 return nullptr; // The clip did not contain any pixels within the re
nder target. |
| 26 } | 26 } |
| 27 return batch; | 27 return batch; |
| 28 } | 28 } |
| 29 | 29 |
| 30 const char* name() const override { return "Clear"; } | 30 const char* name() const override { return "Clear"; } |
| 31 | 31 |
| 32 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()-
>getUniqueID(); } | 32 uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()-
>uniqueID(); } |
| 33 GrRenderTarget* renderTarget() const override { return fRenderTarget.get();
} | 33 GrRenderTarget* renderTarget() const override { return fRenderTarget.get();
} |
| 34 | 34 |
| 35 SkString dumpInfo() const override { | 35 SkString dumpInfo() const override { |
| 36 SkString string("Scissor ["); | 36 SkString string("Scissor ["); |
| 37 if (fClip.scissorEnabled()) { | 37 if (fClip.scissorEnabled()) { |
| 38 const SkIRect& r = fClip.scissorRect(); | 38 const SkIRect& r = fClip.scissorRect(); |
| 39 string.appendf("L: %d, T: %d, R: %d, B: %d", r.fLeft, r.fTop, r.fRig
ht, r.fBottom); | 39 string.appendf("L: %d, T: %d, R: %d, B: %d", r.fLeft, r.fTop, r.fRig
ht, r.fBottom); |
| 40 } | 40 } |
| 41 string.appendf("], Color: 0x%08x, RT: %d", fColor, fRenderTarget.get()->
getUniqueID()); | 41 string.appendf("], Color: 0x%08x, RT: %d", fColor, fRenderTarget.get()->
uniqueID()); |
| 42 string.append(INHERITED::dumpInfo()); | 42 string.append(INHERITED::dumpInfo()); |
| 43 return string; | 43 return string; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void setColor(GrColor color) { fColor = color; } | 46 void setColor(GrColor color) { fColor = color; } |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 GrClearBatch(const GrFixedClip& clip, GrColor color, GrRenderTarget* rt) | 49 GrClearBatch(const GrFixedClip& clip, GrColor color, GrRenderTarget* rt) |
| 50 : INHERITED(ClassID()) | 50 : INHERITED(ClassID()) |
| 51 , fClip(clip) | 51 , fClip(clip) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 GrFixedClip fClip; | 98 GrFixedClip fClip; |
| 99 GrColor fColor; | 99 GrColor fColor; |
| 100 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; | 100 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; |
| 101 | 101 |
| 102 typedef GrBatch INHERITED; | 102 typedef GrBatch INHERITED; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 #endif | 105 #endif |
| OLD | NEW |