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

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

Issue 2769823002: Add decode() functionality to image elements. (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e979d11dae81c634d525135f9ac3ade5f2700b33..92ea0875ec0a6e090b6dc9a9fa71c0b7a018fa32 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -66,6 +66,7 @@
#include "third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h"
#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebSelection.h"
+#include "third_party/skia/include/core/SkImage.h"
#include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
@@ -1096,6 +1097,23 @@ void RenderWidgetCompositor::setBottomControlsHeight(float height) {
layer_tree_host_->SetBottomControlsHeight(height);
}
+void RenderWidgetCompositor::RequestDecode(
+ sk_sp<SkImage> image,
+ const base::Callback<void(bool)>& callback) {
+ layer_tree_host_->QueueImageDecode(std::move(image), callback);
+
+ // If we're compositing synchronously, the SetNeedsCommit call which will be
+ // issued by |layer_tree_host_| is not going to cause a commit, due to the
+ // fact that this would make layout tests slow and cause flakiness. However,
+ // in this case we actually need a commit to transfer the decode requests to
+ // the impl side. So, force a commit to happen.
+ if (CompositeIsSynchronous()) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&RenderWidgetCompositor::SynchronouslyComposite,
+ weak_factory_.GetWeakPtr()));
+ }
+}
+
void RenderWidgetCompositor::WillBeginMainFrame() {
delegate_->WillBeginCompositorFrame();
}
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698