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

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

Issue 1725113002: gpu: Add out-of-line copy ctors for complex classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 30 matching lines...) Expand all
41 // An immutable description that can be used to create a texture that shares 41 // An immutable description that can be used to create a texture that shares
42 // the underlying image buffer(s). 42 // the underlying image buffer(s).
43 class TextureDefinition { 43 class TextureDefinition {
44 public: 44 public:
45 static void AvoidEGLTargetTextureReuse(); 45 static void AvoidEGLTargetTextureReuse();
46 46
47 TextureDefinition(); 47 TextureDefinition();
48 TextureDefinition(Texture* texture, 48 TextureDefinition(Texture* texture,
49 unsigned int version, 49 unsigned int version,
50 const scoped_refptr<NativeImageBuffer>& image); 50 const scoped_refptr<NativeImageBuffer>& image);
51 TextureDefinition(const TextureDefinition& other);
51 virtual ~TextureDefinition(); 52 virtual ~TextureDefinition();
52 53
53 Texture* CreateTexture() const; 54 Texture* CreateTexture() const;
54 55
55 void UpdateTexture(Texture* texture) const; 56 void UpdateTexture(Texture* texture) const;
56 57
57 unsigned int version() const { return version_; } 58 unsigned int version() const { return version_; }
58 bool IsOlderThan(unsigned int version) const { 59 bool IsOlderThan(unsigned int version) const {
59 return (version - version_) < 0x80000000; 60 return (version - version_) < 0x80000000;
60 } 61 }
61 bool Matches(const Texture* texture) const; 62 bool Matches(const Texture* texture) const;
62 63
63 scoped_refptr<NativeImageBuffer> image() const { return image_buffer_; } 64 scoped_refptr<NativeImageBuffer> image() const { return image_buffer_; }
64 65
65 private: 66 private:
66 bool SafeToRenderFrom() const; 67 bool SafeToRenderFrom() const;
67 void UpdateTextureInternal(Texture* texture) const; 68 void UpdateTextureInternal(Texture* texture) const;
68 69
69 struct LevelInfo { 70 struct LevelInfo {
70 LevelInfo(); 71 LevelInfo();
71 LevelInfo(GLenum target, 72 LevelInfo(GLenum target,
72 GLenum internal_format, 73 GLenum internal_format,
73 GLsizei width, 74 GLsizei width,
74 GLsizei height, 75 GLsizei height,
75 GLsizei depth, 76 GLsizei depth,
76 GLint border, 77 GLint border,
77 GLenum format, 78 GLenum format,
78 GLenum type, 79 GLenum type,
79 const gfx::Rect& cleared_rect); 80 const gfx::Rect& cleared_rect);
81 LevelInfo(const LevelInfo& other);
80 ~LevelInfo(); 82 ~LevelInfo();
81 83
82 GLenum target; 84 GLenum target;
83 GLenum internal_format; 85 GLenum internal_format;
84 GLsizei width; 86 GLsizei width;
85 GLsizei height; 87 GLsizei height;
86 GLsizei depth; 88 GLsizei depth;
87 GLint border; 89 GLint border;
88 GLenum format; 90 GLenum format;
89 GLenum type; 91 GLenum type;
(...skipping 12 matching lines...) Expand all
102 bool defined_; 104 bool defined_;
103 105
104 // Only support textures with one face and one level. 106 // Only support textures with one face and one level.
105 LevelInfo level_info_; 107 LevelInfo level_info_;
106 }; 108 };
107 109
108 } // namespage gles2 110 } // namespage gles2
109 } // namespace gpu 111 } // namespace gpu
110 112
111 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ 113 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/sync_point_manager.cc ('k') | gpu/command_buffer/service/texture_definition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698