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
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();
}
*/
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;
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,
}
}
-void GrSurface::prepareForExternalIO() {
- if (!this->wasDestroyed()) {
- this->getContext()->prepareSurfaceForExternalIO(this);
- }
-}
-
bool GrSurface::hasPendingRead() const {
const GrTexture* thisTex = this->asTexture();
if (thisTex && thisTex->internalHasPendingRead()) {
void SkGpuDevice::flush() {
ASSERT_SINGLE_OWNER
- fRenderTarget->prepareForExternalIO();
+ fDrawContext->prepareForExternalIO();
}
///////////////////////////////////////////////////////////////////////////////