Commit 9601f958 authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Remove RequestDecode in RenderWidget.

Implement RequestDecode solely in blink calling a
ScheduleAnimationForWebTests after a decode is queued. This matches the
previous WebWidgetTestProxy override and is a similar flow for
ForcedDraw presentation callback.

BUG=1097816

Change-Id: I0beed33165e4e3b7245c5221ddc3f50bd95b0763
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416256Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808408}
parent d8e1b856
......@@ -904,11 +904,6 @@ void RenderWidget::DidAutoResize(const gfx::Size& new_size) {
}
}
void RenderWidget::RequestDecode(const cc::PaintImage& image,
base::OnceCallback<void(bool)> callback) {
layer_tree_host_->QueueImageDecode(image, std::move(callback));
}
viz::FrameSinkId RenderWidget::GetFrameSinkId() {
return viz::FrameSinkId(RenderThread::Get()->GetClientId(), routing_id());
}
......
......@@ -73,7 +73,6 @@ class WebPagePopup;
} // namespace blink
namespace gfx {
class ColorSpace;
struct PresentationFeedback;
class Range;
}
......@@ -242,8 +241,6 @@ class CONTENT_EXPORT RenderWidget
bool request_unadjusted_movement) override;
void RequestPointerUnlock() override;
bool IsPointerLocked() override;
void RequestDecode(const cc::PaintImage& image,
base::OnceCallback<void(bool)> callback) override;
viz::FrameSinkId GetFrameSinkId() override;
void RecordTimeToFirstActivePaint(base::TimeDelta duration) override;
void DidCommitCompositorFrame(base::TimeTicks commit_start_time) override;
......@@ -343,7 +340,6 @@ class CONTENT_EXPORT RenderWidget
// RenderWidget IPC message handlers.
void OnClose();
void OnCreatingNewAck();
void OnRequestSetBoundsAck();
void OnSetViewportIntersection(
......@@ -376,11 +372,6 @@ class CONTENT_EXPORT RenderWidget
// Used to force the size of a window when running web tests.
void SetWindowRectSynchronously(const gfx::Rect& new_window_rect);
void UpdateTextInputStateInternal(bool show_virtual_keyboard,
bool reply_to_request);
gfx::ColorSpace GetRasterColorSpace() const;
#if BUILDFLAG(ENABLE_PLUGINS)
// Returns the focused pepper plugin, if any, inside the WebWidget. That is
// the pepper plugin which is focused inside a frame which belongs to the
......
......@@ -31,21 +31,6 @@ void WebWidgetTestProxy::WillBeginMainFrame() {
RenderWidget::WillBeginMainFrame();
}
void WebWidgetTestProxy::RequestDecode(
const cc::PaintImage& image,
base::OnceCallback<void(bool)> callback) {
RenderWidget::RequestDecode(image, std::move(callback));
// In web tests the request does not actually cause a commit, because the
// compositor is scheduled by the test runner to avoid flakiness. So for this
// case we must request a main frame the way blink would.
//
// Pass true for |do_raster| to ensure the compositor is actually run, rather
// than just doing the main frame animate step.
if (GetTestRunner()->TestIsRunning())
ScheduleAnimationInternal(/*do_raster=*/true);
}
void WebWidgetTestProxy::ScheduleAnimation() {
if (GetTestRunner()->TestIsRunning())
ScheduleAnimationInternal(GetTestRunner()->animation_requires_raster());
......
......@@ -56,8 +56,6 @@ class WebWidgetTestProxy : public RenderWidget {
// RenderWidget overrides.
void WillBeginMainFrame() override;
void RequestDecode(const cc::PaintImage& image,
base::OnceCallback<void(bool)> callback) override;
void RequestPresentation(PresentationTimeCallback callback) override;
// WebWidgetClient implementation.
......
......@@ -57,10 +57,6 @@
class SkBitmap;
namespace cc {
class PaintImage;
}
namespace gfx {
class Point;
class PointF;
......@@ -180,12 +176,6 @@ class WebWidgetClient {
return false;
}
// Requests an image decode and will have the |callback| run asynchronously
// when it completes. Forces a new main frame to occur that will trigger
// pushing the decode through the compositor.
virtual void RequestDecode(const cc::PaintImage& image,
base::OnceCallback<void(bool)> callback) {}
using LayerTreeFrameSinkCallback = base::OnceCallback<void(
std::unique_ptr<cc::LayerTreeFrameSink>,
std::unique_ptr<cc::RenderFrameMetadataObserver>)>;
......
......@@ -598,7 +598,12 @@ void WebFrameWidgetBase::DidLosePointerLock() {
void WebFrameWidgetBase::RequestDecode(
const PaintImage& image,
base::OnceCallback<void(bool)> callback) {
Client()->RequestDecode(image, std::move(callback));
widget_base_->LayerTreeHost()->QueueImageDecode(image, std::move(callback));
// In web tests the request does not actually cause a commit, because the
// compositor is scheduled by the test runner to avoid flakiness. So for this
// case we must request a main frame.
Client()->ScheduleAnimationForWebTests();
}
void WebFrameWidgetBase::Trace(Visitor* visitor) const {
......
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