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

Side by Side 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: build fix Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SKY_SHELL_GPU_RASTERIZER_H_
6 #define SKY_SHELL_GPU_RASTERIZER_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "skia/ext/refptr.h"
11 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/native_widget_types.h"
13
14 class SkPicture;
15
16 namespace gfx {
17 class GLContext;
18 class GLShareGroup;
19 class GLSurface;
20 }
21
22 namespace sky {
23 namespace shell {
24 class GaneshContext;
25 class GaneshSurface;
26
27 class Rasterizer {
28 public:
29 explicit Rasterizer();
30 ~Rasterizer();
31
32 base::WeakPtr<Rasterizer> GetWeakPtr();
33
34 void Init(gfx::AcceleratedWidget widget);
35 void Draw(skia::RefPtr<SkPicture> picture);
36
37 private:
38 bool CreateGLContext();
39 void EnsureGaneshSurface(const gfx::Size& size);
40
41 scoped_refptr<gfx::GLShareGroup> share_group_;
42 scoped_refptr<gfx::GLSurface> surface_;
43 scoped_refptr<gfx::GLContext> context_;
44
45 scoped_ptr<GaneshContext> ganesh_context_;
46 scoped_ptr<GaneshSurface> ganesh_surface_;
47
48 base::WeakPtrFactory<Rasterizer> weak_factory_;
49
50 DISALLOW_COPY_AND_ASSIGN(Rasterizer);
51 };
52
53 } // namespace shell
54 } // namespace sky
55
56 #endif // SKY_SHELL_GPU_RASTERIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698