Chromium Code Reviews| 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 "ui/compositor/test/in_process_context_factory.h" | 5 #include "ui/compositor/test/in_process_context_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.h" |
| 10 #include "cc/test/test_shared_bitmap_manager.h" | 10 #include "cc/test/test_shared_bitmap_manager.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 Compositor* mirroed_compositor, | 66 Compositor* mirroed_compositor, |
| 67 Layer* mirroring_layer) { | 67 Layer* mirroring_layer) { |
| 68 return new Reflector(); | 68 return new Reflector(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void InProcessContextFactory::RemoveReflector( | 71 void InProcessContextFactory::RemoveReflector( |
| 72 scoped_refptr<Reflector> reflector) {} | 72 scoped_refptr<Reflector> reflector) {} |
| 73 | 73 |
| 74 scoped_refptr<cc::ContextProvider> | 74 scoped_refptr<cc::ContextProvider> |
| 75 InProcessContextFactory::SharedMainThreadContextProvider() { | 75 InProcessContextFactory::SharedMainThreadContextProvider() { |
| 76 if (shared_main_thread_contexts_ && | 76 if (shared_main_thread_contexts_.get() && |
| 77 !shared_main_thread_contexts_->DestroyedOnMainThread()) | 77 !shared_main_thread_contexts_->DestroyedOnMainThread()) |
| 78 return shared_main_thread_contexts_; | 78 return shared_main_thread_contexts_; |
| 79 | 79 |
| 80 bool lose_context_when_out_of_memory = false; | 80 bool lose_context_when_out_of_memory = false; |
| 81 shared_main_thread_contexts_ = | 81 shared_main_thread_contexts_ = |
| 82 webkit::gpu::ContextProviderInProcess::CreateOffscreen( | 82 webkit::gpu::ContextProviderInProcess::CreateOffscreen( |
| 83 lose_context_when_out_of_memory); | 83 lose_context_when_out_of_memory); |
| 84 if (shared_main_thread_contexts_ && | 84 if (shared_main_thread_contexts_.get() && |
| 85 !shared_main_thread_contexts_->BindToCurrentThread()) | 85 !shared_main_thread_contexts_->BindToCurrentThread()) |
| 86 shared_main_thread_contexts_ = NULL; | 86 shared_main_thread_contexts_ = NULL; |
| 87 | 87 |
| 88 return shared_main_thread_contexts_; | 88 return shared_main_thread_contexts_; |
| 89 } | 89 } |
| 90 | 90 |
| 91 void InProcessContextFactory::RemoveCompositor(Compositor* compositor) {} | 91 void InProcessContextFactory::RemoveCompositor(Compositor* compositor) {} |
| 92 | 92 |
| 93 bool InProcessContextFactory::DoesCreateTestContexts() { return false; } | 93 bool InProcessContextFactory::DoesCreateTestContexts() { return false; } |
| 94 | 94 |
| 95 cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() { | 95 cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() { |
| 96 return shared_bitmap_manager_.get(); | 96 return shared_bitmap_manager_.get(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() { | 99 base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() { |
| 100 if (!compositor_thread_) | 100 if (!compositor_thread_) |
| 101 return NULL; | 101 return NULL; |
| 102 return compositor_thread_->message_loop_proxy(); | 102 return compositor_thread_->message_loop_proxy().get(); |
|
danakj
2014/08/25 18:50:48
If I understood your question right, I agree this
| |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace ui | 105 } // namespace ui |
| OLD | NEW |