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

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
123 // Computes the estimated size of a renderbuffer.
124 static bool ComputeEstimatedRenderbufferSize(
125 int width, int height, int samples, int internal_format, uint32* size);
122 126
123 static size_t RenderbufferBytesPerPixel(int format); 127 static size_t RenderbufferBytesPerPixel(int format);
124 128
125 static uint32 GetGLDataTypeSizeForUniforms(int type); 129 static uint32 GetGLDataTypeSizeForUniforms(int type);
126 130
127 static size_t GetGLTypeSizeForTexturesAndBuffers(uint32 type); 131 static size_t GetGLTypeSizeForTexturesAndBuffers(uint32 type);
128 132
129 static uint32 GLErrorToErrorBit(uint32 gl_error); 133 static uint32 GLErrorToErrorBit(uint32 gl_error);
130 134
131 static uint32 GLErrorBitToGLError(uint32 error_bit); 135 static uint32 GLErrorBitToGLError(uint32 error_bit);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 bool buffer_preserved_; 194 bool buffer_preserved_;
191 bool share_resources_; 195 bool share_resources_;
192 bool bind_generates_resource_; 196 bool bind_generates_resource_;
193 }; 197 };
194 198
195 } // namespace gles2 199 } // namespace gles2
196 } // namespace gpu 200 } // namespace gpu
197 201
198 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ 202 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_
199 203
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698