Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: sky/shell/gpu/ganesh_context.h

Issue 891143002: Teach SkyShell how to draw with Ganesh (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Moar comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/shell/BUILD.gn ('k') | sky/shell/gpu/ganesh_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/gpu/ganesh_context.h
diff --git a/sky/shell/gpu/ganesh_context.h b/sky/shell/gpu/ganesh_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..b35158ed3ec0f08e08a87213c588ad5d94b4148d
--- /dev/null
+++ b/sky/shell/gpu/ganesh_context.h
@@ -0,0 +1,37 @@
+// Copyright 2015 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 SKY_SHELL_GPU_GANESH_CONTEXT_H_
+#define SKY_SHELL_GPU_GANESH_CONTEXT_H_
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "skia/ext/refptr.h"
+#include "third_party/skia/include/gpu/GrContext.h"
+#include "ui/gl/gl_context.h"
+
+namespace sky {
+namespace shell {
+
+// GaneshContext holds the top-level context object for Ganesh (known as
+// GrContext). We construct the GrContext using the OpenGL interface provided by
+// gfx::GLContext.
+class GaneshContext {
+ public:
+ explicit GaneshContext(scoped_refptr<gfx::GLContext> gl_context);
+ ~GaneshContext();
+
+ GrContext* gr() const { return gr_context_.get(); }
+
+ private:
+ scoped_refptr<gfx::GLContext> gl_context_;
+ skia::RefPtr<GrContext> gr_context_;
+
+ DISALLOW_COPY_AND_ASSIGN(GaneshContext);
+};
+
+} // namespace shell
+} // namespace sky
+
+#endif // SKY_SHELL_GPU_GANESH_CONTEXT_H_
« no previous file with comments | « sky/shell/BUILD.gn ('k') | sky/shell/gpu/ganesh_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698