| 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 #include "GrImmediateDrawTarget.h" | 8 #include "GrImmediateDrawTarget.h" |
| 9 | 9 |
| 10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 fBatchTarget.postFlush(); | 45 fBatchTarget.postFlush(); |
| 46 | 46 |
| 47 pipeline->~GrPipeline(); | 47 pipeline->~GrPipeline(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void GrImmediateDrawTarget::onClear(const SkIRect* rect, GrColor color, | 50 void GrImmediateDrawTarget::onClear(const SkIRect* rect, GrColor color, |
| 51 bool canIgnoreRect, GrRenderTarget* renderTa
rget) { | 51 bool canIgnoreRect, GrRenderTarget* renderTa
rget) { |
| 52 this->getGpu()->clear(rect, color, canIgnoreRect, renderTarget); | 52 this->getGpu()->clear(rect, color, canIgnoreRect, renderTarget); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void GrImmediateDrawTarget::onCopySurface(GrSurface* dst, | |
| 56 GrSurface* src, | |
| 57 const SkIRect& srcRect, | |
| 58 const SkIPoint& dstPoint) { | |
| 59 SkASSERT(this->getGpu()->canCopySurface(dst, src, srcRect, dstPoint)); | |
| 60 this->getGpu()->copySurface(dst, src, srcRect, dstPoint); | |
| 61 } | |
| 62 | |
| 63 void GrImmediateDrawTarget::clearStencilClip(const SkIRect& rect, | 55 void GrImmediateDrawTarget::clearStencilClip(const SkIRect& rect, |
| 64 bool insideClip, | 56 bool insideClip, |
| 65 GrRenderTarget* renderTarget) { | 57 GrRenderTarget* renderTarget) { |
| 66 this->getGpu()->clearStencilClip(rect, insideClip, renderTarget); | 58 this->getGpu()->clearStencilClip(rect, insideClip, renderTarget); |
| 67 } | 59 } |
| 68 | 60 |
| 69 void GrImmediateDrawTarget::discard(GrRenderTarget* renderTarget) { | 61 void GrImmediateDrawTarget::discard(GrRenderTarget* renderTarget) { |
| 70 if (!this->caps()->discardRenderTargetSupport()) { | 62 if (!this->caps()->discardRenderTargetSupport()) { |
| 71 return; | 63 return; |
| 72 } | 64 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 97 | 89 |
| 98 void GrImmediateDrawTarget::recordXferBarrierIfNecessary(const GrPipeline* pipel
ine) { | 90 void GrImmediateDrawTarget::recordXferBarrierIfNecessary(const GrPipeline* pipel
ine) { |
| 99 const GrXferProcessor& xp = *pipeline->getXferProcessor(); | 91 const GrXferProcessor& xp = *pipeline->getXferProcessor(); |
| 100 GrRenderTarget* rt = pipeline->getRenderTarget(); | 92 GrRenderTarget* rt = pipeline->getRenderTarget(); |
| 101 | 93 |
| 102 GrXferBarrierType barrierType; | 94 GrXferBarrierType barrierType; |
| 103 if (xp.willNeedXferBarrier(rt, *this->caps(), &barrierType)) { | 95 if (xp.willNeedXferBarrier(rt, *this->caps(), &barrierType)) { |
| 104 this->getGpu()->xferBarrier(rt, barrierType); | 96 this->getGpu()->xferBarrier(rt, barrierType); |
| 105 } | 97 } |
| 106 } | 98 } |
| OLD | NEW |