Merge "Do not call postDrawVk if did not call drawVk"

This commit is contained in:
TreeHugger Robot
2019-02-05 06:23:40 +00:00
committed by Android (Google) Code Review
4 changed files with 7 additions and 7 deletions

View File

@@ -142,10 +142,8 @@ void SkiaRecordingCanvas::callDrawGLFunction(Functor* functor,
void SkiaRecordingCanvas::drawWebViewFunctor(int functor) {
FunctorDrawable* functorDrawable;
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) {
// TODO(cblume) use VkFunctorDrawable instead of VkInteropFunctorDrawable here when the
// interop is disabled.
functorDrawable =
mDisplayList->allocateDrawable<VkInteropFunctorDrawable>(functor, asSkCanvas());
mDisplayList->allocateDrawable<VkFunctorDrawable>(functor, asSkCanvas());
} else {
functorDrawable = mDisplayList->allocateDrawable<GLFunctorDrawable>(functor, asSkCanvas());
}

View File

@@ -43,7 +43,9 @@ VkFunctorDrawHandler::VkFunctorDrawHandler(sp<WebViewFunctor::Handle> functor_ha
, mImageInfo(image_info) {}
VkFunctorDrawHandler::~VkFunctorDrawHandler() {
mFunctorHandle->postDrawVk();
if (mDrawn) {
mFunctorHandle->postDrawVk();
}
}
void VkFunctorDrawHandler::draw(const GrBackendDrawableInfo& info) {
@@ -77,6 +79,7 @@ void VkFunctorDrawHandler::draw(const GrBackendDrawableInfo& info) {
params.format = vulkan_info.fFormat;
mFunctorHandle->drawVk(params);
mDrawn = true;
vulkan_info.fDrawBounds->offset.x = mClip.fLeft;
vulkan_info.fDrawBounds->offset.y = mClip.fTop;

View File

@@ -44,6 +44,8 @@ private:
const SkMatrix mMatrix;
const SkIRect mClip;
const SkImageInfo mImageInfo;
bool mDrawn = false;
};
/**

View File

@@ -177,9 +177,6 @@ int CreateFunctor(void* data, AwDrawFnFunctorCallbacks* functor_callbacks) {
webview_functor_callbacks.vk.initialize = &initializeVk;
webview_functor_callbacks.vk.draw = &drawVk;
webview_functor_callbacks.vk.postDraw = &postDrawVk;
// TODO(boliu): Remove this once SkiaRecordingCanvas::drawWebViewFunctor
// no longer uses GL interop.
webview_functor_callbacks.gles.draw = &draw_gl;
break;
}
callbacks_initialized = true;