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

Side by Side Diff: gpu/command_buffer/service/texture_definition.h

Issue 10106015: Allow textures to be moved from one GL context group to another. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_
7
8 #include <vector>
9
10 #include "base/callback.h"
11 #include "gpu/command_buffer/service/gl_utils.h"
12 #include "gpu/gpu_export.h"
13
14 namespace gpu {
15 namespace gles2 {
16
17 // A saved definition of a texture that still exists in the underlying
18 // GLShareGroup and can be used to redefine a client visible texture in any
19 // context using the same GLShareGroup with the corresponding service ID.
20 class GPU_EXPORT TextureDefinition {
21 public:
22 struct LevelInfo {
23 LevelInfo(GLenum target,
24 GLenum internal_format,
25 GLsizei width,
26 GLsizei height,
27 GLsizei depth,
28 GLint border,
29 GLenum format,
30 GLenum type,
31 bool cleared);
32 GLenum target;
33 GLenum internal_format;
34 GLsizei width;
35 GLsizei height;
36 GLsizei depth;
37 GLint border;
38 GLenum format;
39 GLenum type;
40 bool cleared;
41 };
42
43 typedef std::vector<std::vector<LevelInfo> > LevelInfos;
44
45 typedef base::Callback<void(TextureDefinition*)> DestroyCallback;
46
47 TextureDefinition(GLenum target,
48 GLuint service_id,
49 const LevelInfos& level_infos);
50 ~TextureDefinition();
51
52 GLenum target() const {
53 return target_;
54 }
55
56 GLuint ReleaseServiceId();
57
58 const LevelInfos& level_infos() const {
59 return level_infos_;
60 }
61
62 private:
63 GLenum target_;
64 GLuint service_id_;
65 std::vector<std::vector<LevelInfo> > level_infos_;
66
67 DISALLOW_COPY_AND_ASSIGN(TextureDefinition);
68 };
69
70 } // namespage gles2
71 } // namespace gpu
72
73 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_
74
75
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698