Commit bd896549 authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

SkiaOutputSurfaceImplOnGpu: report gpu progress for skia flush

Bug: 1066140
Change-Id: I54dc64bc0138ce3cb9ca30542e662e556e7e6f5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128457
Commit-Queue: Peng Huang <penghuang@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Auto-Submit: Peng Huang <penghuang@chromium.org>
Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754687}
parent 215a97f8
...@@ -829,6 +829,8 @@ SkiaOutputSurfaceImplOnGpu::~SkiaOutputSurfaceImplOnGpu() { ...@@ -829,6 +829,8 @@ SkiaOutputSurfaceImplOnGpu::~SkiaOutputSurfaceImplOnGpu() {
// |context_provider_| and clients want either the context to be lost or made // |context_provider_| and clients want either the context to be lost or made
// current on destruction. // current on destruction.
if (context_state_ && MakeCurrent(false /* need_fbo0 */)) { if (context_state_ && MakeCurrent(false /* need_fbo0 */)) {
gl::ScopedProgressReporter scoped_progress_reporter(
context_state_->progress_reporter());
// This ensures any outstanding callbacks for promise images are performed. // This ensures any outstanding callbacks for promise images are performed.
gr_context()->flush(); gr_context()->flush();
release_current_last_.emplace(gl_surface_, context_state_); release_current_last_.emplace(gl_surface_, context_state_);
...@@ -960,8 +962,13 @@ bool SkiaOutputSurfaceImplOnGpu::FinishPaintCurrentFrame( ...@@ -960,8 +962,13 @@ bool SkiaOutputSurfaceImplOnGpu::FinishPaintCurrentFrame(
if (on_finished) if (on_finished)
gpu::AddCleanupTaskForSkiaFlush(std::move(on_finished), &flush_info); gpu::AddCleanupTaskForSkiaFlush(std::move(on_finished), &flush_info);
auto result = output_sk_surface()->flush( GrSemaphoresSubmitted result;
SkSurface::BackendSurfaceAccess::kPresent, flush_info); {
gl::ScopedProgressReporter scoped_progress_reporter(
context_state_->progress_reporter());
result = output_sk_surface()->flush(
SkSurface::BackendSurfaceAccess::kPresent, flush_info);
}
if (result != GrSemaphoresSubmitted::kYes && if (result != GrSemaphoresSubmitted::kYes &&
!(scoped_promise_image_access.begin_semaphores().empty() && !(scoped_promise_image_access.begin_semaphores().empty() &&
...@@ -1209,6 +1216,8 @@ void SkiaOutputSurfaceImplOnGpu::CopyOutput( ...@@ -1209,6 +1216,8 @@ void SkiaOutputSurfaceImplOnGpu::CopyOutput(
paint.setColor(SK_ColorBLACK); paint.setColor(SK_ColorBLACK);
paint.setBlendMode(SkBlendMode::kDstATop); paint.setBlendMode(SkBlendMode::kDstATop);
surface->getCanvas()->drawPaint(paint); surface->getCanvas()->drawPaint(paint);
gl::ScopedProgressReporter scoped_progress_reporter(
context_state_->progress_reporter());
surface->flush(); surface->flush();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment