OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 MOJO_SKIA_GANESH_SURFACE_H_ | |
6 #define MOJO_SKIA_GANESH_SURFACE_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "mojo/gpu/gl_texture.h" | |
10 #include "mojo/skia/ganesh_context.h" | |
11 #include "skia/ext/refptr.h" | |
12 #include "third_party/skia/include/core/SkSurface.h" | |
13 | |
14 namespace mojo { | |
15 | |
16 // This class represents an SkSurface backed by a GL texture, which is | |
17 // appropriate for use with Ganesh. Note: There's a name collision with | |
18 // mojo::Surface, which is a different concept. | |
19 class GaneshSurface { | |
20 public: | |
21 GaneshSurface(GaneshContext* context, scoped_ptr<GLTexture> texture); | |
22 ~GaneshSurface(); | |
23 | |
24 SkCanvas* canvas() const { return surface_->getCanvas(); } | |
25 scoped_ptr<GLTexture> TakeTexture(); | |
26 | |
27 private: | |
28 scoped_ptr<GLTexture> texture_; | |
29 skia::RefPtr<SkSurface> surface_; | |
30 | |
31 DISALLOW_COPY_AND_ASSIGN(GaneshSurface); | |
32 }; | |
33 | |
34 } // namespace mojo | |
35 | |
36 #endif // MOJO_SKIA_GANESH_SURFACE_H_ | |
OLD | NEW |