| 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 BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 5 #ifndef BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
| 6 #define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 6 #define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "cc/output/context_provider.h" | 15 #include "cc/output/context_provider.h" |
| 16 #include "gpu/command_buffer/client/gl_in_process_context.h" | 16 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 17 #include "skia/ext/refptr.h" | 17 #include "skia/ext/refptr.h" |
| 18 #include "ui/gl/gl_surface.h" | 18 #include "ui/gl/gl_surface.h" |
| 19 | 19 |
| 20 namespace skia_bindings { |
| 21 class GrContextForGLES2Interface; |
| 22 } // namespace skia_bindings |
| 23 |
| 20 namespace blimp { | 24 namespace blimp { |
| 21 namespace client { | 25 namespace client { |
| 22 | 26 |
| 23 // Helper class to provide a graphics context for the compositor. | 27 // Helper class to provide a graphics context for the compositor. |
| 24 class BlimpContextProvider : public cc::ContextProvider { | 28 class BlimpContextProvider : public cc::ContextProvider { |
| 25 public: | 29 public: |
| 26 static scoped_refptr<BlimpContextProvider> Create( | 30 static scoped_refptr<BlimpContextProvider> Create( |
| 27 gfx::AcceleratedWidget widget, | 31 gfx::AcceleratedWidget widget, |
| 28 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); | 32 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
| 29 | 33 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 48 ~BlimpContextProvider() override; | 52 ~BlimpContextProvider() override; |
| 49 | 53 |
| 50 private: | 54 private: |
| 51 void OnLostContext(); | 55 void OnLostContext(); |
| 52 | 56 |
| 53 base::ThreadChecker main_thread_checker_; | 57 base::ThreadChecker main_thread_checker_; |
| 54 base::ThreadChecker context_thread_checker_; | 58 base::ThreadChecker context_thread_checker_; |
| 55 | 59 |
| 56 base::Lock context_lock_; | 60 base::Lock context_lock_; |
| 57 std::unique_ptr<gpu::GLInProcessContext> context_; | 61 std::unique_ptr<gpu::GLInProcessContext> context_; |
| 58 skia::RefPtr<class GrContext> gr_context_; | 62 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
| 59 | 63 |
| 60 cc::ContextProvider::Capabilities capabilities_; | 64 cc::ContextProvider::Capabilities capabilities_; |
| 61 | 65 |
| 62 LostContextCallback lost_context_callback_; | 66 LostContextCallback lost_context_callback_; |
| 63 | 67 |
| 64 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); | 68 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); |
| 65 }; | 69 }; |
| 66 | 70 |
| 67 } // namespace client | 71 } // namespace client |
| 68 } // namespace blimp | 72 } // namespace blimp |
| 69 | 73 |
| 70 #endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 74 #endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
| OLD | NEW |