diff options
author | 2016-07-26 07:41:00 -0700 | |
---|---|---|
committer | 2016-07-26 07:41:01 -0700 | |
commit | 8c523e0f3ffa66eefd70f893e9f863b7d9ea3dc9 (patch) | |
tree | 61e58c77c2a45ab9e5ff0c4d6b9af872d42e0baa /src/gpu | |
parent | 707bbd622b425d5edc96f06580d5ddd3d9cbeb3e (diff) |
Move prepareForExternalIO from GrRenderTarget to GrDrawContext
This is part of the push to remove GrRenderTarget from SkGpuDevice
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2182543003
Review-Url: https://codereview.chromium.org/2182543003
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrDrawContext.cpp | 10 | ||||
-rw-r--r-- | src/gpu/GrSurface.cpp | 6 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 2 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp index 48242e278f..e6bc55b619 100644 --- a/src/gpu/GrDrawContext.cpp +++ b/src/gpu/GrDrawContext.cpp @@ -980,6 +980,16 @@ void GrDrawContext::drawImageNine(const GrClip& clip, this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); } +void GrDrawContext::prepareForExternalIO() { + ASSERT_SINGLE_OWNER + RETURN_IF_ABANDONED + SkDEBUGCODE(this->validate();) + GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::prepareForExternalIO"); + + ASSERT_OWNED_RESOURCE(fRenderTarget); + + fDrawingManager->getContext()->prepareSurfaceForExternalIO(fRenderTarget.get()); +} void GrDrawContext::drawNonAAFilledRect(const GrClip& clip, const GrPaint& paint, diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp index 6dc90a3d1a..824a6a2936 100644 --- a/src/gpu/GrSurface.cpp +++ b/src/gpu/GrSurface.cpp @@ -149,12 +149,6 @@ void GrSurface::flushWrites() { } } -void GrSurface::prepareForExternalIO() { - if (!this->wasDestroyed()) { - this->getContext()->prepareSurfaceForExternalIO(this); - } -} - bool GrSurface::hasPendingRead() const { const GrTexture* thisTex = this->asTexture(); if (thisTex && thisTex->internalHasPendingRead()) { diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 5bc347c5d0..116d3c6e4c 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1727,7 +1727,7 @@ bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { void SkGpuDevice::flush() { ASSERT_SINGLE_OWNER - fRenderTarget->prepareForExternalIO(); + fDrawContext->prepareForExternalIO(); } /////////////////////////////////////////////////////////////////////////////// |