OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/public/test/layouttest_support.h" | 5 #include "content/public/test/layouttest_support.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 task_runner = base::ThreadTaskRunnerHandle::Get().get(); | 348 task_runner = base::ThreadTaskRunnerHandle::Get().get(); |
349 | 349 |
350 cc::LayerTreeSettings settings = | 350 cc::LayerTreeSettings settings = |
351 RenderWidgetCompositor::GenerateLayerTreeSettings( | 351 RenderWidgetCompositor::GenerateLayerTreeSettings( |
352 *base::CommandLine::ForCurrentProcess(), deps, 1.f); | 352 *base::CommandLine::ForCurrentProcess(), deps, 1.f); |
353 | 353 |
354 auto compositor_frame_sink = base::MakeUnique<cc::TestCompositorFrameSink>( | 354 auto compositor_frame_sink = base::MakeUnique<cc::TestCompositorFrameSink>( |
355 std::move(compositor_context_provider), | 355 std::move(compositor_context_provider), |
356 std::move(worker_context_provider), nullptr /* shared_bitmap_manager */, | 356 std::move(worker_context_provider), nullptr /* shared_bitmap_manager */, |
357 gpu_memory_buffer_manager, settings.renderer_settings, task_runner, | 357 gpu_memory_buffer_manager, settings.renderer_settings, task_runner, |
358 synchronous_composite, false /* force_disable_reclaim_resources */); | 358 synchronous_composite); |
359 compositor_frame_sink->SetClient(this); | 359 compositor_frame_sink->SetClient(this); |
360 // Always swap (regardless of damage) to ensure that we can capture frames. | |
361 compositor_frame_sink->SetAlwaysSwap(); | |
danakj
2017/01/11 19:28:24
Instead we could have the code that inserts a copy
ericrk
2017/01/11 23:10:50
Added the invalidation to the code that triggers t
| |
360 compositor_frame_sinks_[routing_id] = compositor_frame_sink.get(); | 362 compositor_frame_sinks_[routing_id] = compositor_frame_sink.get(); |
361 return std::move(compositor_frame_sink); | 363 return std::move(compositor_frame_sink); |
362 } | 364 } |
363 | 365 |
364 std::unique_ptr<cc::SwapPromise> RequestCopyOfOutput( | 366 std::unique_ptr<cc::SwapPromise> RequestCopyOfOutput( |
365 int32_t routing_id, | 367 int32_t routing_id, |
366 std::unique_ptr<cc::CopyOutputRequest> request) override { | 368 std::unique_ptr<cc::CopyOutputRequest> request) override { |
367 // Note that we can't immediately check compositor_frame_sinks_, since it | 369 // Note that we can't immediately check compositor_frame_sinks_, since it |
368 // may not have been created yet. Instead, we wait until OnCommit to find | 370 // may not have been created yet. Instead, we wait until OnCommit to find |
369 // the currently active CompositorFrameSink for the given RenderWidget | 371 // the currently active CompositorFrameSink for the given RenderWidget |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
599 | 601 |
600 void ForceTextInputStateUpdateForRenderFrame(RenderFrame* frame) { | 602 void ForceTextInputStateUpdateForRenderFrame(RenderFrame* frame) { |
601 if (auto* render_widget = | 603 if (auto* render_widget = |
602 static_cast<RenderFrameImpl*>(frame)->GetRenderWidget()) { | 604 static_cast<RenderFrameImpl*>(frame)->GetRenderWidget()) { |
603 render_widget->UpdateTextInputState(ShowIme::IF_NEEDED, | 605 render_widget->UpdateTextInputState(ShowIme::IF_NEEDED, |
604 ChangeSource::FROM_NON_IME); | 606 ChangeSource::FROM_NON_IME); |
605 } | 607 } |
606 } | 608 } |
607 | 609 |
608 } // namespace content | 610 } // namespace content |
OLD | NEW |