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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2929493002: Plumb PaintImage for the img.decode instead of SkImage. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 1090
1091 void RenderWidgetCompositor::SetBrowserControlsShownRatio(float ratio) { 1091 void RenderWidgetCompositor::SetBrowserControlsShownRatio(float ratio) {
1092 layer_tree_host_->SetBrowserControlsShownRatio(ratio); 1092 layer_tree_host_->SetBrowserControlsShownRatio(ratio);
1093 } 1093 }
1094 1094
1095 void RenderWidgetCompositor::setBottomControlsHeight(float height) { 1095 void RenderWidgetCompositor::setBottomControlsHeight(float height) {
1096 layer_tree_host_->SetBottomControlsHeight(height); 1096 layer_tree_host_->SetBottomControlsHeight(height);
1097 } 1097 }
1098 1098
1099 void RenderWidgetCompositor::RequestDecode( 1099 void RenderWidgetCompositor::RequestDecode(
1100 sk_sp<SkImage> image, 1100 const PaintImage& image,
1101 const base::Callback<void(bool)>& callback) { 1101 const base::Callback<void(bool)>& callback) {
1102 layer_tree_host_->QueueImageDecode(std::move(image), callback); 1102 layer_tree_host_->QueueImageDecode(image, callback);
1103 1103
1104 // If we're compositing synchronously, the SetNeedsCommit call which will be 1104 // If we're compositing synchronously, the SetNeedsCommit call which will be
1105 // issued by |layer_tree_host_| is not going to cause a commit, due to the 1105 // issued by |layer_tree_host_| is not going to cause a commit, due to the
1106 // fact that this would make layout tests slow and cause flakiness. However, 1106 // fact that this would make layout tests slow and cause flakiness. However,
1107 // in this case we actually need a commit to transfer the decode requests to 1107 // in this case we actually need a commit to transfer the decode requests to
1108 // the impl side. So, force a commit to happen. 1108 // the impl side. So, force a commit to happen.
1109 if (CompositeIsSynchronous()) { 1109 if (CompositeIsSynchronous()) {
1110 base::ThreadTaskRunnerHandle::Get()->PostTask( 1110 base::ThreadTaskRunnerHandle::Get()->PostTask(
1111 FROM_HERE, base::Bind(&RenderWidgetCompositor::SynchronouslyComposite, 1111 FROM_HERE, base::Bind(&RenderWidgetCompositor::SynchronouslyComposite,
1112 weak_factory_.GetWeakPtr())); 1112 weak_factory_.GetWeakPtr()));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 const cc::LocalSurfaceId& local_surface_id) { 1254 const cc::LocalSurfaceId& local_surface_id) {
1255 layer_tree_host_->SetLocalSurfaceId(local_surface_id); 1255 layer_tree_host_->SetLocalSurfaceId(local_surface_id);
1256 } 1256 }
1257 1257
1258 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) { 1258 void RenderWidgetCompositor::NotifySwapTime(ReportTimeCallback callback) {
1259 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>( 1259 QueueSwapPromise(base::MakeUnique<ReportTimeSwapPromise>(
1260 std::move(callback), base::ThreadTaskRunnerHandle::Get())); 1260 std::move(callback), base::ThreadTaskRunnerHandle::Get()));
1261 } 1261 }
1262 1262
1263 } // namespace content 1263 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | third_party/WebKit/Source/core/exported/WebViewBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698