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/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "base/test/simple_test_tick_clock.h" | 19 #include "base/test/simple_test_tick_clock.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "cc/output/begin_frame_args.h" | 21 #include "cc/output/begin_frame_args.h" |
22 #include "cc/output/compositor_frame.h" | 22 #include "cc/output/compositor_frame.h" |
23 #include "cc/output/compositor_frame_metadata.h" | 23 #include "cc/output/compositor_frame_metadata.h" |
24 #include "cc/output/copy_output_request.h" | 24 #include "cc/output/copy_output_request.h" |
25 #include "cc/surfaces/surface.h" | 25 #include "cc/surfaces/surface.h" |
26 #include "cc/surfaces/surface_manager.h" | 26 #include "cc/surfaces/surface_manager.h" |
| 27 #include "components/display_compositor/gl_helper.h" |
27 #include "content/browser/browser_thread_impl.h" | 28 #include "content/browser/browser_thread_impl.h" |
28 #include "content/browser/compositor/gl_helper.h" | |
29 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" | 29 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" |
30 #include "content/browser/frame_host/render_widget_host_view_guest.h" | 30 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
31 #include "content/browser/gpu/compositor_util.h" | 31 #include "content/browser/gpu/compositor_util.h" |
32 #include "content/browser/renderer_host/input/input_router.h" | 32 #include "content/browser/renderer_host/input/input_router.h" |
33 #include "content/browser/renderer_host/input/mouse_wheel_event_queue.h" | 33 #include "content/browser/renderer_host/input/mouse_wheel_event_queue.h" |
34 #include "content/browser/renderer_host/input/web_input_event_util.h" | 34 #include "content/browser/renderer_host/input/web_input_event_util.h" |
35 #include "content/browser/renderer_host/overscroll_controller.h" | 35 #include "content/browser/renderer_host/overscroll_controller.h" |
36 #include "content/browser/renderer_host/overscroll_controller_delegate.h" | 36 #include "content/browser/renderer_host/overscroll_controller_delegate.h" |
37 #include "content/browser/renderer_host/render_view_host_factory.h" | 37 #include "content/browser/renderer_host/render_view_host_factory.h" |
38 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 38 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 void RunOnCompositingDidCommit() { | 304 void RunOnCompositingDidCommit() { |
305 GetDelegatedFrameHost()->OnCompositingDidCommitForTesting( | 305 GetDelegatedFrameHost()->OnCompositingDidCommitForTesting( |
306 window()->GetHost()->compositor()); | 306 window()->GetHost()->compositor()); |
307 } | 307 } |
308 | 308 |
309 void InterceptCopyOfOutput(std::unique_ptr<cc::CopyOutputRequest> request) { | 309 void InterceptCopyOfOutput(std::unique_ptr<cc::CopyOutputRequest> request) { |
310 last_copy_request_ = std::move(request); | 310 last_copy_request_ = std::move(request); |
311 if (last_copy_request_->has_texture_mailbox()) { | 311 if (last_copy_request_->has_texture_mailbox()) { |
312 // Give the resulting texture a size. | 312 // Give the resulting texture a size. |
313 GLHelper* gl_helper = ImageTransportFactory::GetInstance()->GetGLHelper(); | 313 display_compositor::GLHelper* gl_helper = |
| 314 ImageTransportFactory::GetInstance()->GetGLHelper(); |
314 GLuint texture = gl_helper->ConsumeMailboxToTexture( | 315 GLuint texture = gl_helper->ConsumeMailboxToTexture( |
315 last_copy_request_->texture_mailbox().mailbox(), | 316 last_copy_request_->texture_mailbox().mailbox(), |
316 last_copy_request_->texture_mailbox().sync_token()); | 317 last_copy_request_->texture_mailbox().sync_token()); |
317 gl_helper->ResizeTexture(texture, window()->bounds().size()); | 318 gl_helper->ResizeTexture(texture, window()->bounds().size()); |
318 gl_helper->DeleteTexture(texture); | 319 gl_helper->DeleteTexture(texture); |
319 } | 320 } |
320 } | 321 } |
321 | 322 |
322 cc::SurfaceId surface_id() const { | 323 cc::SurfaceId surface_id() const { |
323 return GetDelegatedFrameHost()->SurfaceIdForTesting(); | 324 return GetDelegatedFrameHost()->SurfaceIdForTesting(); |
(...skipping 4150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4474 view()->OnGestureEvent(&gesture_event); | 4475 view()->OnGestureEvent(&gesture_event); |
4475 | 4476 |
4476 EXPECT_TRUE(delegate->context_menu_request_received()); | 4477 EXPECT_TRUE(delegate->context_menu_request_received()); |
4477 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); | 4478 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); |
4478 #endif | 4479 #endif |
4479 | 4480 |
4480 RenderViewHostFactory::set_is_real_render_view_host(false); | 4481 RenderViewHostFactory::set_is_real_render_view_host(false); |
4481 } | 4482 } |
4482 | 4483 |
4483 } // namespace content | 4484 } // namespace content |
OLD | NEW |