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
This commit is contained in:
parent
707bbd622b
commit
8c523e0f3f
@ -253,6 +253,12 @@ public:
|
||||
const SkIRect& center,
|
||||
const SkRect& dst);
|
||||
|
||||
/**
|
||||
* After this returns any pending surface IO will be issued to the backend 3D API and
|
||||
* if the surface has MSAA it will be resolved.
|
||||
*/
|
||||
void prepareForExternalIO();
|
||||
|
||||
bool isStencilBufferMultisampled() const {
|
||||
return fRenderTarget->isStencilBufferMultisampled();
|
||||
}
|
||||
|
@ -114,13 +114,6 @@ public:
|
||||
*/
|
||||
void flushWrites();
|
||||
|
||||
|
||||
/**
|
||||
* After this returns any pending surface IO will be issued to the backend 3D API and
|
||||
* if the surface has MSAA it will be resolved.
|
||||
*/
|
||||
void prepareForExternalIO();
|
||||
|
||||
/** Access methods that are only to be used within Skia code. */
|
||||
inline GrSurfacePriv surfacePriv();
|
||||
inline const GrSurfacePriv surfacePriv() const;
|
||||
|
@ -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,
|
||||
|
@ -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()) {
|
||||
|
@ -1727,7 +1727,7 @@ bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const {
|
||||
void SkGpuDevice::flush() {
|
||||
ASSERT_SINGLE_OWNER
|
||||
|
||||
fRenderTarget->prepareForExternalIO();
|
||||
fDrawContext->prepareForExternalIO();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user