| 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/compositor_impl_android.h" | 5 #include "content/browser/renderer_host/compositor_impl_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/threading/thread.h" | 21 #include "base/threading/thread.h" |
| 22 #include "base/threading/thread_checker.h" | 22 #include "base/threading/thread_checker.h" |
| 23 #include "cc/base/switches.h" | 23 #include "cc/base/switches.h" |
| 24 #include "cc/input/input_handler.h" | 24 #include "cc/input/input_handler.h" |
| 25 #include "cc/layers/layer.h" | 25 #include "cc/layers/layer.h" |
| 26 #include "cc/output/compositor_frame.h" | 26 #include "cc/output/compositor_frame.h" |
| 27 #include "cc/output/context_provider.h" | 27 #include "cc/output/context_provider.h" |
| 28 #include "cc/output/output_surface.h" | 28 #include "cc/output/output_surface.h" |
| 29 #include "cc/output/output_surface_client.h" | 29 #include "cc/output/output_surface_client.h" |
| 30 #include "cc/scheduler/begin_frame_source.h" | 30 #include "cc/scheduler/begin_frame_source.h" |
| 31 #include "cc/surfaces/onscreen_display_client.h" |
| 32 #include "cc/surfaces/surface_display_output_surface.h" |
| 31 #include "cc/surfaces/surface_id_allocator.h" | 33 #include "cc/surfaces/surface_id_allocator.h" |
| 32 #include "cc/surfaces/surface_manager.h" | 34 #include "cc/surfaces/surface_manager.h" |
| 33 #include "cc/trees/layer_tree_host.h" | 35 #include "cc/trees/layer_tree_host.h" |
| 34 #include "content/browser/android/child_process_launcher_android.h" | 36 #include "content/browser/android/child_process_launcher_android.h" |
| 35 #include "content/browser/compositor/onscreen_display_client.h" | |
| 36 #include "content/browser/compositor/surface_display_output_surface.h" | |
| 37 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 37 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 38 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 38 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 39 #include "content/browser/gpu/compositor_util.h" | 39 #include "content/browser/gpu/compositor_util.h" |
| 40 #include "content/browser/gpu/gpu_surface_tracker.h" | 40 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 41 #include "content/browser/renderer_host/render_widget_host_impl.h" | 41 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 42 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 42 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
| 43 #include "content/common/gpu/client/context_provider_command_buffer.h" | 43 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 44 #include "content/common/gpu/client/gl_helper.h" | 44 #include "content/common/gpu/client/gl_helper.h" |
| 45 #include "content/common/gpu/client/gpu_channel_host.h" | 45 #include "content/common/gpu/client/gpu_channel_host.h" |
| 46 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 46 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 weak_factory_.GetWeakPtr())); | 584 weak_factory_.GetWeakPtr())); |
| 585 return; | 585 return; |
| 586 } | 586 } |
| 587 | 587 |
| 588 scoped_ptr<cc::OutputSurface> real_output_surface( | 588 scoped_ptr<cc::OutputSurface> real_output_surface( |
| 589 new OutputSurfaceWithoutParent(context_provider, | 589 new OutputSurfaceWithoutParent(context_provider, |
| 590 weak_factory_.GetWeakPtr())); | 590 weak_factory_.GetWeakPtr())); |
| 591 | 591 |
| 592 cc::SurfaceManager* manager = GetSurfaceManager(); | 592 cc::SurfaceManager* manager = GetSurfaceManager(); |
| 593 if (manager) { | 593 if (manager) { |
| 594 display_client_.reset( | 594 display_client_.reset(new cc::OnscreenDisplayClient( |
| 595 new OnscreenDisplayClient(real_output_surface.Pass(), manager, | 595 real_output_surface.Pass(), manager, HostSharedBitmapManager::current(), |
| 596 host_->settings().renderer_settings, | 596 BrowserGpuMemoryBufferManager::current(), |
| 597 base::MessageLoopProxy::current())); | 597 host_->settings().renderer_settings, |
| 598 scoped_ptr<SurfaceDisplayOutputSurface> surface_output_surface( | 598 base::MessageLoopProxy::current())); |
| 599 new SurfaceDisplayOutputSurface(manager, surface_id_allocator_.get(), | 599 scoped_ptr<cc::SurfaceDisplayOutputSurface> surface_output_surface( |
| 600 context_provider)); | 600 new cc::SurfaceDisplayOutputSurface( |
| 601 manager, surface_id_allocator_.get(), context_provider)); |
| 601 | 602 |
| 602 display_client_->set_surface_output_surface(surface_output_surface.get()); | 603 display_client_->set_surface_output_surface(surface_output_surface.get()); |
| 603 surface_output_surface->set_display_client(display_client_.get()); | 604 surface_output_surface->set_display_client(display_client_.get()); |
| 604 display_client_->display()->Resize(size_); | 605 display_client_->display()->Resize(size_); |
| 605 host_->SetOutputSurface(surface_output_surface.Pass()); | 606 host_->SetOutputSurface(surface_output_surface.Pass()); |
| 606 } else { | 607 } else { |
| 607 host_->SetOutputSurface(real_output_surface.Pass()); | 608 host_->SetOutputSurface(real_output_surface.Pass()); |
| 608 } | 609 } |
| 609 } | 610 } |
| 610 | 611 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 | 699 |
| 699 void CompositorImpl::SetNeedsAnimate() { | 700 void CompositorImpl::SetNeedsAnimate() { |
| 700 needs_animate_ = true; | 701 needs_animate_ = true; |
| 701 if (!host_) | 702 if (!host_) |
| 702 return; | 703 return; |
| 703 | 704 |
| 704 host_->SetNeedsAnimate(); | 705 host_->SetNeedsAnimate(); |
| 705 } | 706 } |
| 706 | 707 |
| 707 } // namespace content | 708 } // namespace content |
| OLD | NEW |