OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_GRCONTEXT_PROVIDER_H_ |
| 6 #define CC_GRCONTEXT_PROVIDER_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/cc_export.h" |
| 10 |
| 11 class GrContext; |
| 12 namespace WebKit { class WebGraphicsContext3D; } |
| 13 |
| 14 namespace cc { |
| 15 class ResourceProvider; |
| 16 |
| 17 class CC_EXPORT GrContextProvider { |
| 18 public: |
| 19 GrContextProvider(ResourceProvider* resource_provider); |
| 20 virtual ~GrContextProvider(); |
| 21 |
| 22 void set_contexts(WebKit::WebGraphicsContext3D* context3d, |
| 23 GrContext* gr_context) { |
| 24 context3d_ = context3d; |
| 25 gr_context_ = gr_context; |
| 26 } |
| 27 |
| 28 bool has_contexts() { return context3d_ && gr_context_; } |
| 29 |
| 30 WebKit::WebGraphicsContext3D* context3d() { |
| 31 return context3d_; |
| 32 } |
| 33 GrContext* gr_context() { |
| 34 return gr_context_; |
| 35 } |
| 36 |
| 37 void BeginUsingContexts(); |
| 38 void FinishUsingContexts(); |
| 39 |
| 40 private: |
| 41 ResourceProvider* resource_provider_; |
| 42 WebKit::WebGraphicsContext3D* context3d_; |
| 43 GrContext* gr_context_; |
| 44 }; |
| 45 |
| 46 } // namespace cc |
| 47 |
| 48 #endif // CC_GRCONTEXT_PROVIDER_H_ |
OLD | NEW |