OLD | NEW |
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 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 std::unique_ptr<cc::CopyOutputRequest> request = | 912 std::unique_ptr<cc::CopyOutputRequest> request = |
913 cc::CopyOutputRequest::CreateBitmapRequest(base::Bind( | 913 cc::CopyOutputRequest::CreateBitmapRequest(base::Bind( |
914 [](blink::WebCompositeAndReadbackAsyncCallback* callback, | 914 [](blink::WebCompositeAndReadbackAsyncCallback* callback, |
915 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 915 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
916 std::unique_ptr<cc::CopyOutputResult> result) { | 916 std::unique_ptr<cc::CopyOutputResult> result) { |
917 task_runner->PostTask(FROM_HERE, | 917 task_runner->PostTask(FROM_HERE, |
918 base::Bind(&CompositeAndReadbackAsyncCallback, | 918 base::Bind(&CompositeAndReadbackAsyncCallback, |
919 callback, base::Passed(&result))); | 919 callback, base::Passed(&result))); |
920 }, | 920 }, |
921 callback, base::Passed(&main_thread_task_runner))); | 921 callback, base::Passed(&main_thread_task_runner))); |
922 // Force a redraw to ensure that the copy swap promise isn't cancelled due to | |
923 // no damage. | |
924 SetNeedsForcedRedraw(); | |
925 layer_tree_host_->QueueSwapPromise( | 922 layer_tree_host_->QueueSwapPromise( |
926 delegate_->RequestCopyOfOutputForLayoutTest(std::move(request))); | 923 delegate_->RequestCopyOfOutputForLayoutTest(std::move(request))); |
927 | 924 |
928 // Force a commit to happen. The temporary copy output request will | 925 // Force a commit to happen. The temporary copy output request will |
929 // be installed after layout which will happen as a part of the commit, for | 926 // be installed after layout which will happen as a part of the commit, for |
930 // widgets that delay the creation of their output surface. | 927 // widgets that delay the creation of their output surface. |
931 if (CompositeIsSynchronous()) { | 928 if (CompositeIsSynchronous()) { |
932 base::ThreadTaskRunnerHandle::Get()->PostTask( | 929 base::ThreadTaskRunnerHandle::Get()->PostTask( |
933 FROM_HERE, base::Bind(&RenderWidgetCompositor::SynchronouslyComposite, | 930 FROM_HERE, base::Bind(&RenderWidgetCompositor::SynchronouslyComposite, |
934 weak_factory_.GetWeakPtr())); | 931 weak_factory_.GetWeakPtr())); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 float device_scale) { | 1134 float device_scale) { |
1138 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); | 1135 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); |
1139 } | 1136 } |
1140 | 1137 |
1141 void RenderWidgetCompositor::SetDeviceColorSpace( | 1138 void RenderWidgetCompositor::SetDeviceColorSpace( |
1142 const gfx::ColorSpace& color_space) { | 1139 const gfx::ColorSpace& color_space) { |
1143 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); | 1140 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); |
1144 } | 1141 } |
1145 | 1142 |
1146 } // namespace content | 1143 } // namespace content |
OLD | NEW |