OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/compositor/gpu_process_transport_factory.h" | 5 #include "content/browser/compositor/gpu_process_transport_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "content/common/gpu/gpu_process_launch_causes.h" | 40 #include "content/common/gpu/gpu_process_launch_causes.h" |
41 #include "content/common/host_shared_bitmap_manager.h" | 41 #include "content/common/host_shared_bitmap_manager.h" |
42 #include "content/public/common/content_switches.h" | 42 #include "content/public/common/content_switches.h" |
43 #include "gpu/GLES2/gl2extchromium.h" | 43 #include "gpu/GLES2/gl2extchromium.h" |
44 #include "gpu/command_buffer/client/gles2_interface.h" | 44 #include "gpu/command_buffer/client/gles2_interface.h" |
45 #include "gpu/command_buffer/common/mailbox.h" | 45 #include "gpu/command_buffer/common/mailbox.h" |
46 #include "third_party/khronos/GLES2/gl2.h" | 46 #include "third_party/khronos/GLES2/gl2.h" |
47 #include "ui/compositor/compositor.h" | 47 #include "ui/compositor/compositor.h" |
48 #include "ui/compositor/compositor_constants.h" | 48 #include "ui/compositor/compositor_constants.h" |
49 #include "ui/compositor/compositor_switches.h" | 49 #include "ui/compositor/compositor_switches.h" |
| 50 #include "ui/compositor/layer.h" |
50 #include "ui/gfx/geometry/size.h" | 51 #include "ui/gfx/geometry/size.h" |
51 #include "ui/gfx/native_widget_types.h" | 52 #include "ui/gfx/native_widget_types.h" |
52 | 53 |
53 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
54 #include "content/browser/compositor/software_output_device_win.h" | 55 #include "content/browser/compositor/software_output_device_win.h" |
55 #elif defined(USE_OZONE) | 56 #elif defined(USE_OZONE) |
56 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor_ozone.h" | 57 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor_ozone.h" |
57 #include "content/browser/compositor/software_output_device_ozone.h" | 58 #include "content/browser/compositor/software_output_device_ozone.h" |
58 #include "ui/ozone/public/ozone_switches.h" | 59 #include "ui/ozone/public/ozone_switches.h" |
59 #include "ui/ozone/public/surface_factory_ozone.h" | 60 #include "ui/ozone/public/surface_factory_ozone.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 ReflectorImpl* reflector; | 95 ReflectorImpl* reflector; |
95 scoped_ptr<cc::OnscreenDisplayClient> display_client; | 96 scoped_ptr<cc::OnscreenDisplayClient> display_client; |
96 | 97 |
97 PerCompositorData() : surface_id(0), surface(nullptr), reflector(nullptr) {} | 98 PerCompositorData() : surface_id(0), surface(nullptr), reflector(nullptr) {} |
98 }; | 99 }; |
99 | 100 |
100 GpuProcessTransportFactory::GpuProcessTransportFactory() | 101 GpuProcessTransportFactory::GpuProcessTransportFactory() |
101 : next_surface_id_namespace_(1u), | 102 : next_surface_id_namespace_(1u), |
102 task_graph_runner_(new cc::TaskGraphRunner), | 103 task_graph_runner_(new cc::TaskGraphRunner), |
103 callback_factory_(this) { | 104 callback_factory_(this) { |
| 105 ui::Layer::InitializeUILayerSettings(); |
| 106 |
104 if (UseSurfacesEnabled()) | 107 if (UseSurfacesEnabled()) |
105 surface_manager_ = make_scoped_ptr(new cc::SurfaceManager); | 108 surface_manager_ = make_scoped_ptr(new cc::SurfaceManager); |
106 | 109 |
107 if (ui::IsUIImplSidePaintingEnabled()) { | 110 if (ui::IsUIImplSidePaintingEnabled()) { |
108 raster_thread_.reset(new RasterThread(task_graph_runner_.get())); | 111 raster_thread_.reset(new RasterThread(task_graph_runner_.get())); |
109 raster_thread_->Start(); | 112 raster_thread_->Start(); |
110 } | 113 } |
111 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
112 software_backing_.reset(new OutputDeviceBacking); | 115 software_backing_.reset(new OutputDeviceBacking); |
113 #endif | 116 #endif |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 606 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
604 observer_list_, | 607 observer_list_, |
605 OnLostResources()); | 608 OnLostResources()); |
606 | 609 |
607 // Kill things that use the shared context before killing the shared context. | 610 // Kill things that use the shared context before killing the shared context. |
608 lost_gl_helper.reset(); | 611 lost_gl_helper.reset(); |
609 lost_shared_main_thread_contexts = NULL; | 612 lost_shared_main_thread_contexts = NULL; |
610 } | 613 } |
611 | 614 |
612 } // namespace content | 615 } // namespace content |
OLD | NEW |