OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef COMPONENTS_HTML_VIEWER_SETUP_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_SETUP_H_ |
6 #define COMPONENTS_HTML_VIEWER_SETUP_H_ | 6 #define COMPONENTS_HTML_VIEWER_SETUP_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
11 #include "components/html_viewer/discardable_memory_allocator.h" | 11 #include "components/html_viewer/discardable_memory_allocator.h" |
12 #include "components/resource_provider/public/cpp/resource_loader.h" | 12 #include "components/resource_provider/public/cpp/resource_loader.h" |
| 13 #include "components/view_manager/gles2/mojo_gpu_memory_buffer_manager.h" |
| 14 #include "components/view_manager/gles2/raster_thread_helper.h" |
13 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
14 | 16 |
15 namespace mojo { | 17 namespace mojo { |
16 class ApplicationImpl; | 18 class ApplicationImpl; |
17 class Shell; | 19 class Shell; |
18 } | 20 } |
19 | 21 |
20 namespace scheduler { | 22 namespace scheduler { |
21 class RendererScheduler; | 23 class RendererScheduler; |
22 } | 24 } |
(...skipping 28 matching lines...) Expand all Loading... |
51 const gfx::Size& screen_size_in_pixels() const { | 53 const gfx::Size& screen_size_in_pixels() const { |
52 return screen_size_in_pixels_; | 54 return screen_size_in_pixels_; |
53 } | 55 } |
54 | 56 |
55 float device_pixel_ratio() const { return device_pixel_ratio_; } | 57 float device_pixel_ratio() const { return device_pixel_ratio_; } |
56 | 58 |
57 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread() { | 59 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread() { |
58 return compositor_thread_.task_runner(); | 60 return compositor_thread_.task_runner(); |
59 } | 61 } |
60 | 62 |
| 63 gles2::RasterThreadHelper* raster_thread_helper() { |
| 64 return &raster_thread_helper_; |
| 65 } |
| 66 |
| 67 gles2::MojoGpuMemoryBufferManager* gpu_memory_buffer_manager() { |
| 68 return &gpu_memory_buffer_manager_; |
| 69 } |
| 70 |
61 MediaFactory* media_factory() { return media_factory_.get(); } | 71 MediaFactory* media_factory() { return media_factory_.get(); } |
62 | 72 |
63 private: | 73 private: |
64 // App for HTMLViewer, not the document's app. | 74 // App for HTMLViewer, not the document's app. |
65 // WARNING: do not expose this. It's too easy to use the wrong one. | 75 // WARNING: do not expose this. It's too easy to use the wrong one. |
66 // HTMLDocument should be using the application it creates, not this one. | 76 // HTMLDocument should be using the application it creates, not this one. |
67 mojo::ApplicationImpl* app_; | 77 mojo::ApplicationImpl* app_; |
68 | 78 |
69 resource_provider::ResourceLoader resource_loader_; | 79 resource_provider::ResourceLoader resource_loader_; |
70 | 80 |
(...skipping 12 matching lines...) Expand all Loading... |
83 // this doesn't use purgable shared memory. Instead, it tries to free the | 93 // this doesn't use purgable shared memory. Instead, it tries to free the |
84 // oldest unlocked chunks on allocation. | 94 // oldest unlocked chunks on allocation. |
85 // | 95 // |
86 // TODO(erg): In the long run, delete this allocator and get the real shared | 96 // TODO(erg): In the long run, delete this allocator and get the real shared |
87 // memory based purging allocator working here. | 97 // memory based purging allocator working here. |
88 DiscardableMemoryAllocator discardable_memory_allocator_; | 98 DiscardableMemoryAllocator discardable_memory_allocator_; |
89 | 99 |
90 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler_; | 100 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler_; |
91 scoped_ptr<BlinkPlatformImpl> blink_platform_; | 101 scoped_ptr<BlinkPlatformImpl> blink_platform_; |
92 base::Thread compositor_thread_; | 102 base::Thread compositor_thread_; |
| 103 gles2::RasterThreadHelper raster_thread_helper_; |
| 104 gles2::MojoGpuMemoryBufferManager gpu_memory_buffer_manager_; |
93 scoped_ptr<MediaFactory> media_factory_; | 105 scoped_ptr<MediaFactory> media_factory_; |
94 | 106 |
95 DISALLOW_COPY_AND_ASSIGN(Setup); | 107 DISALLOW_COPY_AND_ASSIGN(Setup); |
96 }; | 108 }; |
97 | 109 |
98 } // namespace html_viewer | 110 } // namespace html_viewer |
99 | 111 |
100 #endif // COMPONENTS_HTML_VIEWER_SETUP_H_ | 112 #endif // COMPONENTS_HTML_VIEWER_SETUP_H_ |
OLD | NEW |