OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SKY_SHELL_GPU_RASTERIZER_H_ | 5 #ifndef SKY_SHELL_GPU_RASTERIZER_H_ |
6 #define SKY_SHELL_GPU_RASTERIZER_H_ | 6 #define SKY_SHELL_GPU_RASTERIZER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "skia/ext/refptr.h" | 10 #include "skia/ext/refptr.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 class Rasterizer : public GPUDelegate { | 28 class Rasterizer : public GPUDelegate { |
29 public: | 29 public: |
30 explicit Rasterizer(); | 30 explicit Rasterizer(); |
31 ~Rasterizer(); | 31 ~Rasterizer(); |
32 | 32 |
33 base::WeakPtr<Rasterizer> GetWeakPtr(); | 33 base::WeakPtr<Rasterizer> GetWeakPtr(); |
34 | 34 |
35 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override; | 35 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override; |
36 void OnOutputSurfaceDestroyed() override; | 36 void OnOutputSurfaceDestroyed() override; |
37 | 37 void Draw(skia::RefPtr<SkPicture> picture) override; |
38 void Draw(skia::RefPtr<SkPicture> picture); | |
39 | 38 |
40 private: | 39 private: |
41 bool CreateGLContext(); | 40 void EnsureGLContext(); |
42 void EnsureGaneshSurface(const gfx::Size& size); | 41 void EnsureGaneshSurface(const gfx::Size& size); |
43 | 42 |
44 scoped_refptr<gfx::GLShareGroup> share_group_; | 43 scoped_refptr<gfx::GLShareGroup> share_group_; |
45 scoped_refptr<gfx::GLSurface> surface_; | 44 scoped_refptr<gfx::GLSurface> surface_; |
46 scoped_refptr<gfx::GLContext> context_; | 45 scoped_refptr<gfx::GLContext> context_; |
47 | 46 |
48 scoped_ptr<GaneshContext> ganesh_context_; | 47 scoped_ptr<GaneshContext> ganesh_context_; |
49 scoped_ptr<GaneshSurface> ganesh_surface_; | 48 scoped_ptr<GaneshSurface> ganesh_surface_; |
50 | 49 |
51 base::WeakPtrFactory<Rasterizer> weak_factory_; | 50 base::WeakPtrFactory<Rasterizer> weak_factory_; |
52 | 51 |
53 DISALLOW_COPY_AND_ASSIGN(Rasterizer); | 52 DISALLOW_COPY_AND_ASSIGN(Rasterizer); |
54 }; | 53 }; |
55 | 54 |
56 } // namespace shell | 55 } // namespace shell |
57 } // namespace sky | 56 } // namespace sky |
58 | 57 |
59 #endif // SKY_SHELL_GPU_RASTERIZER_H_ | 58 #endif // SKY_SHELL_GPU_RASTERIZER_H_ |
OLD | NEW |