| Index: blimp/client/support/compositor/compositor_dependencies_impl.cc
|
| diff --git a/blimp/client/support/compositor/compositor_dependencies_impl.cc b/blimp/client/support/compositor/compositor_dependencies_impl.cc
|
| index 56ebf21a719a0a50be423d0fe3a3b8655f7744ee..4b0fdce1fbf1fb7aa10ad6a6256c75682f685988 100644
|
| --- a/blimp/client/support/compositor/compositor_dependencies_impl.cc
|
| +++ b/blimp/client/support/compositor/compositor_dependencies_impl.cc
|
| @@ -11,10 +11,6 @@
|
| #include "cc/surfaces/surface_manager.h"
|
| #include "cc/trees/layer_tree_settings.h"
|
|
|
| -#if defined(OS_ANDROID)
|
| -#include "ui/gfx/android/device_display_info.h"
|
| -#endif
|
| -
|
| namespace blimp {
|
| namespace client {
|
|
|
| @@ -26,62 +22,6 @@ CompositorDependenciesImpl::CompositorDependenciesImpl()
|
|
|
| CompositorDependenciesImpl::~CompositorDependenciesImpl() = default;
|
|
|
| -cc::LayerTreeSettings* CompositorDependenciesImpl::GetLayerTreeSettings() {
|
| - if (!settings_) {
|
| - settings_ = base::MakeUnique<cc::LayerTreeSettings>();
|
| -
|
| - PopulateCommonLayerTreeSettings(settings_.get());
|
| - settings_->abort_commit_before_output_surface_creation = false;
|
| - settings_->renderer_settings.buffer_to_texture_target_map =
|
| - BlimpGpuMemoryBufferManager::GetDefaultBufferToTextureTargetMap();
|
| - settings_->use_output_surface_begin_frame_source = true;
|
| -
|
| - int default_tile_size = 256;
|
| -#if defined(OS_ANDROID)
|
| - gfx::DeviceDisplayInfo info;
|
| - bool real_size_supported = true;
|
| - int display_width = info.GetPhysicalDisplayWidth();
|
| - int display_height = info.GetPhysicalDisplayHeight();
|
| - if (display_width == 0 || display_height == 0) {
|
| - real_size_supported = false;
|
| - display_width = info.GetDisplayWidth();
|
| - display_height = info.GetDisplayHeight();
|
| - }
|
| -
|
| - int portrait_width = std::min(display_width, display_height);
|
| - int landscape_width = std::max(display_width, display_height);
|
| -
|
| - if (real_size_supported) {
|
| - // Maximum HD dimensions should be 768x1280
|
| - // Maximum FHD dimensions should be 1200x1920
|
| - if (portrait_width > 768 || landscape_width > 1280)
|
| - default_tile_size = 384;
|
| - if (portrait_width > 1200 || landscape_width > 1920)
|
| - default_tile_size = 512;
|
| -
|
| - // Adjust for some resolutions that barely straddle an extra
|
| - // tile when in portrait mode. This helps worst case scroll/raster
|
| - // by not needing a full extra tile for each row.
|
| - if (default_tile_size == 256 && portrait_width == 768)
|
| - default_tile_size += 32;
|
| - if (default_tile_size == 384 && portrait_width == 1200)
|
| - default_tile_size += 32;
|
| - } else {
|
| - // We don't know the exact resolution due to screen controls etc.
|
| - // So this just estimates the values above using tile counts.
|
| - int numTiles = (display_width * display_height) / (256 * 256);
|
| - if (numTiles > 16)
|
| - default_tile_size = 384;
|
| - if (numTiles >= 40)
|
| - default_tile_size = 512;
|
| - }
|
| -#endif
|
| - settings_->default_tile_size.SetSize(default_tile_size, default_tile_size);
|
| - }
|
| -
|
| - return settings_.get();
|
| -}
|
| -
|
| gpu::GpuMemoryBufferManager*
|
| CompositorDependenciesImpl::GetGpuMemoryBufferManager() {
|
| return gpu_memory_buffer_manager_.get();
|
| @@ -91,15 +31,18 @@ cc::SurfaceManager* CompositorDependenciesImpl::GetSurfaceManager() {
|
| return surface_manager_.get();
|
| }
|
|
|
| -uint32_t CompositorDependenciesImpl::AllocateSurfaceId() {
|
| +uint32_t CompositorDependenciesImpl::AllocateSurfaceClientId() {
|
| return ++next_surface_id_;
|
| }
|
|
|
| -void CompositorDependenciesImpl::GetContextProvider(
|
| +void CompositorDependenciesImpl::GetContextProviders(
|
| const CompositorDependencies::ContextProviderCallback& callback) {
|
| - scoped_refptr<cc::ContextProvider> provider = BlimpContextProvider::Create(
|
| - gfx::kNullAcceleratedWidget, gpu_memory_buffer_manager_.get());
|
| - callback.Run(provider);
|
| + scoped_refptr<cc::ContextProvider> compositor_context =
|
| + BlimpContextProvider::Create(gfx::kNullAcceleratedWidget,
|
| + gpu_memory_buffer_manager_.get());
|
| +
|
| + // TODO(khushalsagar): Make a worker context and bind to the current thread.
|
| + callback.Run(compositor_context, nullptr);
|
| }
|
|
|
| } // namespace client
|
|
|