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 GrCopySurfaceBatch_DEFINED | 8 #ifndef GrCopySurfaceBatch_DEFINED |
9 #define GrCopySurfaceBatch_DEFINED | 9 #define GrCopySurfaceBatch_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 "GrRenderTarget.h" | 14 #include "GrRenderTarget.h" |
15 | 15 |
16 class GrCopySurfaceBatch final : public GrBatch { | 16 class GrCopySurfaceBatch final : public GrBatch { |
17 public: | 17 public: |
18 DEFINE_BATCH_CLASS_ID | 18 DEFINE_BATCH_CLASS_ID |
19 | 19 |
20 static GrBatch* Create(GrSurface* dst, GrSurface* src, const SkIRect& srcRec
t, | 20 static GrBatch* Create(GrSurface* dst, GrSurface* src, const SkIRect& srcRec
t, |
21 const SkIPoint& dstPoint); | 21 const SkIPoint& dstPoint); |
22 | 22 |
23 const char* name() const override { return "CopySurface"; } | 23 const char* name() const override { return "CopySurface"; } |
24 | 24 |
25 uint32_t renderTargetUniqueID() const override { | 25 uint32_t renderTargetUniqueID() const override { |
26 GrRenderTarget* rt = fDst.get()->asRenderTarget(); | 26 GrRenderTarget* rt = fDst.get()->asRenderTarget(); |
27 return rt ? rt->getUniqueID() : 0; | 27 return rt ? rt->getUniqueID() : 0; |
28 } | 28 } |
| 29 GrRenderTarget* renderTarget() const override { return fDst.get()->asRenderT
arget(); } |
29 | 30 |
30 SkString dumpInfo() const override { | 31 SkString dumpInfo() const override { |
31 SkString string; | 32 SkString string; |
32 string.printf("SRC: 0x%p, DST: 0x%p, SRECT: [L: %d, T: %d, R: %d, B: %d]
, " | 33 string.printf("SRC: 0x%p, DST: 0x%p, SRECT: [L: %d, T: %d, R: %d, B: %d]
, " |
33 "DPT:[X: %d, Y: %d]", | 34 "DPT:[X: %d, Y: %d]", |
34 fDst.get(), fSrc.get(), fSrcRect.fLeft, fSrcRect.fTop, fSr
cRect.fRight, | 35 fDst.get(), fSrc.get(), fSrcRect.fLeft, fSrcRect.fTop, fSr
cRect.fRight, |
35 fSrcRect.fBottom, fDstPoint.fX, fDstPoint.fY); | 36 fSrcRect.fBottom, fDstPoint.fX, fDstPoint.fY); |
36 return string; | 37 return string; |
37 } | 38 } |
38 | 39 |
(...skipping 19 matching lines...) Expand all Loading... |
58 | 59 |
59 GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst; | 60 GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst; |
60 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc; | 61 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc; |
61 SkIRect fSrcRect; | 62 SkIRect fSrcRect; |
62 SkIPoint fDstPoint; | 63 SkIPoint fDstPoint; |
63 | 64 |
64 typedef GrBatch INHERITED; | 65 typedef GrBatch INHERITED; |
65 }; | 66 }; |
66 | 67 |
67 #endif | 68 #endif |
OLD | NEW |