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

Unified Diff: sky/shell/gpu/rasterizer.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/gpu/ganesh_surface.cc ('k') | sky/shell/gpu/rasterizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/gpu/rasterizer.h
diff --git a/sky/shell/gpu/rasterizer.h b/sky/shell/gpu/rasterizer.h
new file mode 100644
index 0000000000000000000000000000000000000000..302e38d9e3c7b28ca7e21e6f164bdab1d382ff4b
--- /dev/null
+++ b/sky/shell/gpu/rasterizer.h
@@ -0,0 +1,56 @@
+// 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_RASTERIZER_H_
+#define SKY_SHELL_GPU_RASTERIZER_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "skia/ext/refptr.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/native_widget_types.h"
+
+class SkPicture;
+
+namespace gfx {
+class GLContext;
+class GLShareGroup;
+class GLSurface;
+}
+
+namespace sky {
+namespace shell {
+class GaneshContext;
+class GaneshSurface;
+
+class Rasterizer {
+ public:
+ explicit Rasterizer();
+ ~Rasterizer();
+
+ base::WeakPtr<Rasterizer> GetWeakPtr();
+
+ void Init(gfx::AcceleratedWidget widget);
+ void Draw(skia::RefPtr<SkPicture> picture);
+
+ private:
+ bool CreateGLContext();
+ void EnsureGaneshSurface(const gfx::Size& size);
+
+ scoped_refptr<gfx::GLShareGroup> share_group_;
+ scoped_refptr<gfx::GLSurface> surface_;
+ scoped_refptr<gfx::GLContext> context_;
+
+ scoped_ptr<GaneshContext> ganesh_context_;
+ scoped_ptr<GaneshSurface> ganesh_surface_;
+
+ base::WeakPtrFactory<Rasterizer> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(Rasterizer);
+};
+
+} // namespace shell
+} // namespace sky
+
+#endif // SKY_SHELL_GPU_RASTERIZER_H_
« no previous file with comments | « sky/shell/gpu/ganesh_surface.cc ('k') | sky/shell/gpu/rasterizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698