Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1275)

Side by Side Diff: ui/compositor/test/in_process_context_factory.h

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_widget.cc ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_FACTORY_H_ 5 #ifndef UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_FACTORY_H_
6 #define UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_FACTORY_H_ 6 #define UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_FACTORY_H_
7 7
8 #include "cc/test/test_gpu_memory_buffer_manager.h" 8 #include "cc/test/test_gpu_memory_buffer_manager.h"
9 #include "cc/test/test_image_factory.h" 9 #include "cc/test/test_image_factory.h"
10 #include "cc/test/test_shared_bitmap_manager.h" 10 #include "cc/test/test_shared_bitmap_manager.h"
11 #include "cc/test/test_task_graph_runner.h" 11 #include "cc/test/test_task_graph_runner.h"
12 #include "ui/compositor/compositor.h" 12 #include "ui/compositor/compositor.h"
13 13
14 namespace base { 14 namespace base {
15 class Thread; 15 class Thread;
16 } 16 }
17 17
18 namespace cc { 18 namespace cc {
19 class OnscreenDisplayClient; 19 class OnscreenDisplayClient;
20 class SurfaceManager; 20 class SurfaceManager;
21 } 21 }
22 22
23 namespace ui { 23 namespace ui {
24 class InProcessContextProvider;
24 25
25 class InProcessContextFactory : public ContextFactory { 26 class InProcessContextFactory : public ContextFactory {
26 public: 27 public:
27 // surface_manager is owned by the creator of this and must outlive the 28 // surface_manager is owned by the creator of this and must outlive the
28 // context factory. 29 // context factory.
29 InProcessContextFactory(bool context_factory_for_test, 30 InProcessContextFactory(bool context_factory_for_test,
30 cc::SurfaceManager* surface_manager); 31 cc::SurfaceManager* surface_manager);
31 ~InProcessContextFactory() override; 32 ~InProcessContextFactory() override;
32 33
33 // If true (the default) an OutputSurface is created that does not display 34 // If true (the default) an OutputSurface is created that does not display
(...skipping 15 matching lines...) Expand all
49 uint32 GetImageTextureTarget(gfx::BufferFormat format, 50 uint32 GetImageTextureTarget(gfx::BufferFormat format,
50 gfx::BufferUsage usage) override; 51 gfx::BufferUsage usage) override;
51 cc::SharedBitmapManager* GetSharedBitmapManager() override; 52 cc::SharedBitmapManager* GetSharedBitmapManager() override;
52 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; 53 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
53 cc::TaskGraphRunner* GetTaskGraphRunner() override; 54 cc::TaskGraphRunner* GetTaskGraphRunner() override;
54 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; 55 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override;
55 void ResizeDisplay(ui::Compositor* compositor, 56 void ResizeDisplay(ui::Compositor* compositor,
56 const gfx::Size& size) override; 57 const gfx::Size& size) override;
57 58
58 private: 59 private:
59 scoped_refptr<cc::ContextProvider> shared_main_thread_contexts_; 60 scoped_refptr<InProcessContextProvider> shared_main_thread_contexts_;
61 scoped_refptr<InProcessContextProvider> shared_worker_context_provider_;
60 cc::TestSharedBitmapManager shared_bitmap_manager_; 62 cc::TestSharedBitmapManager shared_bitmap_manager_;
61 cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; 63 cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
62 cc::TestImageFactory image_factory_; 64 cc::TestImageFactory image_factory_;
63 cc::TestTaskGraphRunner task_graph_runner_; 65 cc::TestTaskGraphRunner task_graph_runner_;
64 uint32_t next_surface_id_namespace_; 66 uint32_t next_surface_id_namespace_;
65 bool use_test_surface_; 67 bool use_test_surface_;
66 bool context_factory_for_test_; 68 bool context_factory_for_test_;
67 cc::SurfaceManager* surface_manager_; 69 cc::SurfaceManager* surface_manager_;
68 70
69 base::hash_map<Compositor*, cc::OnscreenDisplayClient*> per_compositor_data_; 71 base::hash_map<Compositor*, cc::OnscreenDisplayClient*> per_compositor_data_;
70 72
71 DISALLOW_COPY_AND_ASSIGN(InProcessContextFactory); 73 DISALLOW_COPY_AND_ASSIGN(InProcessContextFactory);
72 }; 74 };
73 75
74 } // namespace ui 76 } // namespace ui
75 77
76 #endif // UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_FACTORY_H_ 78 #endif // UI_COMPOSITOR_TEST_IN_PROCESS_CONTEXT_FACTORY_H_
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698