Index: cc/grcontext_provider.h |
diff --git a/cc/grcontext_provider.h b/cc/grcontext_provider.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f118f1c345db92a5276109b76e44bc2f6f471d19 |
--- /dev/null |
+++ b/cc/grcontext_provider.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CC_GRCONTEXT_PROVIDER_H_ |
+#define CC_GRCONTEXT_PROVIDER_H_ |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "cc/cc_export.h" |
+ |
+class GrContext; |
+namespace WebKit { class WebGraphicsContext3D; } |
+ |
+namespace cc { |
+class ResourceProvider; |
+ |
+class CC_EXPORT GrContextProvider { |
+ public: |
+ GrContextProvider(ResourceProvider* resource_provider); |
+ virtual ~GrContextProvider(); |
+ |
+ void set_contexts(WebKit::WebGraphicsContext3D* context3d, |
+ GrContext* gr_context) { |
+ context3d_ = context3d; |
+ gr_context_ = gr_context; |
+ } |
+ |
+ bool has_contexts() { return context3d_ && gr_context_; } |
+ |
+ WebKit::WebGraphicsContext3D* context3d() { |
+ return context3d_; |
+ } |
+ GrContext* gr_context() { |
+ return gr_context_; |
+ } |
+ |
+ void BeginUsingContexts(); |
+ void FinishUsingContexts(); |
+ |
+ private: |
+ ResourceProvider* resource_provider_; |
+ WebKit::WebGraphicsContext3D* context3d_; |
+ GrContext* gr_context_; |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_GRCONTEXT_PROVIDER_H_ |