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

Side by Side Diff: gpu/command_buffer/common/gles2_cmd_utils.h

Issue 12017032: Add calls to EnsureGPUMemoryAvailable into GLES2DecoderImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 // This file is here so other GLES2 related files can have a common set of 5 // This file is here so other GLES2 related files can have a common set of
6 // includes where appropriate. 6 // includes where appropriate.
7 7
8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ 8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_
9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ 9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 // Gets the number of values a particular id will return when a glGet 103 // Gets the number of values a particular id will return when a glGet
104 // function is called. If 0 is returned the id is invalid. 104 // function is called. If 0 is returned the id is invalid.
105 int GLGetNumValuesReturned(int id) const; 105 int GLGetNumValuesReturned(int id) const;
106 106
107 // Computes the size of a single group of elements from a format and type pair 107 // Computes the size of a single group of elements from a format and type pair
108 static uint32 ComputeImageGroupSize(int format, int type); 108 static uint32 ComputeImageGroupSize(int format, int type);
109 109
110 // Computes the size of an image row including alignment padding 110 // Computes the size of an image row including alignment padding
111 static bool ComputeImagePaddedRowSize( 111 static bool ComputeImagePaddedRowSize(
112 int width, int format, int type, int unpack_alignment, 112 int width, int format, int type, int unpack_alignment,
113 uint32* padded_row_size); 113 uint32* padded_row_size);
114 114
115 // Computes the size of image data for TexImage2D and TexSubImage2D. 115 // Computes the size of image data for TexImage2D and TexSubImage2D.
116 // Optionally the unpadded and padded row sizes can be returned. If height < 2 116 // Optionally the unpadded and padded row sizes can be returned. If height < 2
117 // then the padded_row_size will be the same as the unpadded_row_size since 117 // then the padded_row_size will be the same as the unpadded_row_size since
118 // padding is not necessary. 118 // padding is not necessary.
119 static bool ComputeImageDataSizes( 119 static bool ComputeImageDataSizes(
120 int width, int height, int format, int type, int unpack_alignment, 120 int width, int height, int format, int type, int unpack_alignment,
121 uint32* size, uint32* unpadded_row_size, uint32* padded_row_size); 121 uint32* size, uint32* unpadded_row_size, uint32* padded_row_size);
122 122
123 static size_t RenderbufferBytesPerPixel(int format); 123 static size_t RenderbufferBytesPerPixel(int format);
124 124
125 static uint32 GetGLDataTypeSizeForUniforms(int type); 125 static uint32 GetGLDataTypeSizeForUniforms(int type);
126 126
127 static size_t GetGLTypeSizeForTexturesAndBuffers(uint32 type); 127 static size_t GetGLTypeSizeForTexturesAndBuffers(uint32 type);
128 128
129 static uint32 GLErrorToErrorBit(uint32 gl_error); 129 static uint32 GLErrorToErrorBit(uint32 gl_error);
130 130
131 static uint32 GLErrorBitToGLError(uint32 error_bit); 131 static uint32 GLErrorBitToGLError(uint32 error_bit);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 bool buffer_preserved_; 190 bool buffer_preserved_;
191 bool share_resources_; 191 bool share_resources_;
192 bool bind_generates_resource_; 192 bool bind_generates_resource_;
193 }; 193 };
194 194
195 } // namespace gles2 195 } // namespace gles2
196 } // namespace gpu 196 } // namespace gpu
197 197
198 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ 198 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_
199 199
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_memory_tracking.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698