Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(969)

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2034393003: testRunner.layoutAndPaintAsyncThen ==> testRunner.compositeAsyncThen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 79bda8eeffbb748e78b5877a64c2f306f9d1db5a..b0a8c645d1dee065c7572fff3a51ff400c8ce307 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -52,8 +52,8 @@
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallback.h"
+#include "third_party/WebKit/public/platform/WebCompositeCallback.h"
#include "third_party/WebKit/public/platform/WebCompositorMutatorClient.h"
-#include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h"
#include "third_party/WebKit/public/platform/WebSize.h"
#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
@@ -223,7 +223,6 @@ RenderWidgetCompositor::RenderWidgetCompositor(
delegate_(delegate),
compositor_deps_(compositor_deps),
never_visible_(false),
- layout_and_paint_async_callback_(nullptr),
remote_proto_channel_receiver_(nullptr),
weak_factory_(this) {}
@@ -805,7 +804,7 @@ bool RenderWidgetCompositor::haveScrollEventHandlers() const {
void CompositeAndReadbackAsyncCallback(
blink::WebCompositeAndReadbackAsyncCallback* callback,
std::unique_ptr<cc::CopyOutputResult> result) {
- if (result->HasBitmap()) {
+ if (callback->needsBitmap() && result->HasBitmap()) {
std::unique_ptr<SkBitmap> result_bitmap = result->TakeBitmap();
callback->didCompositeAndReadback(*result_bitmap);
} else {
@@ -818,36 +817,9 @@ bool RenderWidgetCompositor::CompositeIsSynchronous() const {
!layer_tree_host_->settings().single_thread_proxy_scheduler;
}
-void RenderWidgetCompositor::layoutAndPaintAsync(
- blink::WebLayoutAndPaintAsyncCallback* callback) {
- DCHECK(!temporary_copy_output_request_ && !layout_and_paint_async_callback_);
- layout_and_paint_async_callback_ = callback;
-
- if (CompositeIsSynchronous()) {
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(&RenderWidgetCompositor::LayoutAndUpdateLayers,
- weak_factory_.GetWeakPtr()));
- } else {
- layer_tree_host_->SetNeedsCommit();
- }
-}
-
-void RenderWidgetCompositor::LayoutAndUpdateLayers() {
- DCHECK(CompositeIsSynchronous());
- layer_tree_host_->LayoutAndUpdateLayers();
- InvokeLayoutAndPaintCallback();
-}
-
-void RenderWidgetCompositor::InvokeLayoutAndPaintCallback() {
- if (!layout_and_paint_async_callback_)
- return;
- layout_and_paint_async_callback_->didLayoutAndPaint();
- layout_and_paint_async_callback_ = nullptr;
-}
-
void RenderWidgetCompositor::compositeAndReadbackAsync(
blink::WebCompositeAndReadbackAsyncCallback* callback) {
- DCHECK(!temporary_copy_output_request_ && !layout_and_paint_async_callback_);
+ DCHECK(!temporary_copy_output_request_);
temporary_copy_output_request_ =
cc::CopyOutputRequest::CreateBitmapRequest(
base::Bind(&CompositeAndReadbackAsyncCallback, callback));
@@ -1002,7 +974,6 @@ void RenderWidgetCompositor::DidFailToInitializeOutputSurface() {
}
void RenderWidgetCompositor::WillCommit() {
- InvokeLayoutAndPaintCallback();
}
void RenderWidgetCompositor::DidCommit() {
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698