| 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_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 5 #ifndef BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
| 6 #define BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 6 #define BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
| 13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
| 14 #include "cc/output/context_provider.h" | 14 #include "cc/output/context_provider.h" |
| 15 #include "gpu/command_buffer/client/gl_in_process_context.h" | 15 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 16 #include "skia/ext/refptr.h" | 16 #include "skia/ext/refptr.h" |
| 17 #include "ui/gl/gl_surface.h" | 17 #include "ui/gl/gl_surface.h" |
| 18 | 18 |
| 19 namespace blimp { | 19 namespace blimp { |
| 20 namespace client { |
| 20 | 21 |
| 21 // Helper class to provide a graphics context for the compositor. | 22 // Helper class to provide a graphics context for the compositor. |
| 22 class BlimpContextProvider : public cc::ContextProvider { | 23 class BlimpContextProvider : public cc::ContextProvider { |
| 23 public: | 24 public: |
| 24 static scoped_refptr<BlimpContextProvider> Create( | 25 static scoped_refptr<BlimpContextProvider> Create( |
| 25 gfx::AcceleratedWidget widget); | 26 gfx::AcceleratedWidget widget); |
| 26 | 27 |
| 27 // cc::ContextProvider implementation. | 28 // cc::ContextProvider implementation. |
| 28 bool BindToCurrentThread() override; | 29 bool BindToCurrentThread() override; |
| 29 void DetachFromThread() override; | 30 void DetachFromThread() override; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 52 scoped_ptr<gpu::GLInProcessContext> context_; | 53 scoped_ptr<gpu::GLInProcessContext> context_; |
| 53 skia::RefPtr<class GrContext> gr_context_; | 54 skia::RefPtr<class GrContext> gr_context_; |
| 54 | 55 |
| 55 cc::ContextProvider::Capabilities capabilities_; | 56 cc::ContextProvider::Capabilities capabilities_; |
| 56 | 57 |
| 57 LostContextCallback lost_context_callback_; | 58 LostContextCallback lost_context_callback_; |
| 58 | 59 |
| 59 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); | 60 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); |
| 60 }; | 61 }; |
| 61 | 62 |
| 63 } // namespace client |
| 62 } // namespace blimp | 64 } // namespace blimp |
| 63 | 65 |
| 64 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 66 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
| OLD | NEW |