| 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 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } | 49 } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 GrCopySurfaceBatch(GrSurface* dst, GrSurface* src, const SkIRect& srcRect, | 52 GrCopySurfaceBatch(GrSurface* dst, GrSurface* src, const SkIRect& srcRect, |
| 53 const SkIPoint& dstPoint) | 53 const SkIPoint& dstPoint) |
| 54 : INHERITED(ClassID()) | 54 : INHERITED(ClassID()) |
| 55 , fDst(dst) | 55 , fDst(dst) |
| 56 , fSrc(src) | 56 , fSrc(src) |
| 57 , fSrcRect(srcRect) | 57 , fSrcRect(srcRect) |
| 58 , fDstPoint(dstPoint) { | 58 , fDstPoint(dstPoint) { |
| 59 fBounds = SkRect::MakeXYWH(SkIntToScalar(dstPoint.fX), SkIntToScalar(dst
Point.fY), | 59 SkRect bounds = |
| 60 SkIntToScalar(srcRect.width()), SkIntToScalar
(srcRect.height())); | 60 SkRect::MakeXYWH(SkIntToScalar(dstPoint.fX), SkIntToScalar(dstPo
int.fY), |
| 61 SkIntToScalar(srcRect.width()), SkIntToScalar(s
rcRect.height())); |
| 62 this->setBounds(bounds, HasAABloat::kNo, IsZeroArea::kNo); |
| 61 } | 63 } |
| 62 | 64 |
| 63 bool onCombineIfPossible(GrBatch* that, const GrCaps& caps) override { retur
n false; } | 65 bool onCombineIfPossible(GrBatch* that, const GrCaps& caps) override { retur
n false; } |
| 64 | 66 |
| 65 void onPrepare(GrBatchFlushState*) override {} | 67 void onPrepare(GrBatchFlushState*) override {} |
| 66 | 68 |
| 67 void onDraw(GrBatchFlushState* state) override { | 69 void onDraw(GrBatchFlushState* state) override { |
| 68 if (!state->commandBuffer()) { | 70 if (!state->commandBuffer()) { |
| 69 state->gpu()->copySurface(fDst.get(), fSrc.get(), fSrcRect, fDstPoin
t); | 71 state->gpu()->copySurface(fDst.get(), fSrc.get(), fSrcRect, fDstPoin
t); |
| 70 } else { | 72 } else { |
| 71 // currently we are not sending copies through the GrGpuCommandBuffe
r | 73 // currently we are not sending copies through the GrGpuCommandBuffe
r |
| 72 SkASSERT(false); | 74 SkASSERT(false); |
| 73 } | 75 } |
| 74 } | 76 } |
| 75 | 77 |
| 76 GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst; | 78 GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst; |
| 77 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc; | 79 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc; |
| 78 SkIRect fSrcRect; | 80 SkIRect fSrcRect; |
| 79 SkIPoint fDstPoint; | 81 SkIPoint fDstPoint; |
| 80 | 82 |
| 81 typedef GrBatch INHERITED; | 83 typedef GrBatch INHERITED; |
| 82 }; | 84 }; |
| 83 | 85 |
| 84 #endif | 86 #endif |
| OLD | NEW |