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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 962723002: Change CHROMIUM_image declarations to support multi planar input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mcasas@comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 59385241e5c89526420ceda1fd8c50d75fc050b1..c9451302d5063040aa37983b1a93d12c19d0aaa6 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -4713,27 +4713,34 @@ bool ValidImageUsage(GLenum usage) {
} // namespace
-GLuint GLES2Implementation::CreateImageCHROMIUMHelper(ClientBuffer buffer,
+GLuint GLES2Implementation::CreateImageCHROMIUMHelper(ClientBuffer* buffers,
GLsizei width,
GLsizei height,
GLenum internalformat) {
+ if (buffers == nullptr) {
reveman 2015/03/02 20:09:55 I don't think this check makes sense. We used to c
emircan 2015/03/03 02:02:18 I agree there is no way to check each of the multi
reveman 2015/03/03 05:57:09 In general, I don't think it makes sense to check
emircan 2015/03/04 03:03:15 Changed it as suggested.
+ SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "invalid |buffers|");
+ return 0;
+ }
+
if (width <= 0) {
- SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "width <= 0");
+ SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "|width| <= 0");
reveman 2015/03/02 20:09:56 | is typically used when referring to variables in
reveman 2015/03/02 20:09:56 | is typically used when referring to variables in
emircan 2015/03/03 02:02:19 Done.
return 0;
}
if (height <= 0) {
- SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "height <= 0");
+ SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "|height| <= 0");
reveman 2015/03/02 20:09:56 ditto
emircan 2015/03/03 02:02:18 Done.
return 0;
}
if (!ValidImageFormat(internalformat)) {
- SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "invalid format");
+ SetGLError(GL_INVALID_ENUM, "glCreateImageCHROMIUM", "invalid format");
return 0;
}
+ // TODO(emircan): See http://crbug.com/439520; support passing multiple
+ // buffers when new multi-planar formats are added.
int32_t image_id =
- gpu_control_->CreateImage(buffer, width, height, internalformat);
+ gpu_control_->CreateImage(buffers[0], width, height, internalformat);
reveman 2015/03/02 20:09:55 I think we should update the GpuControl interface
if (image_id < 0) {
SetGLError(GL_OUT_OF_MEMORY, "glCreateImageCHROMIUM", "image_id < 0");
return 0;
@@ -4741,7 +4748,7 @@ GLuint GLES2Implementation::CreateImageCHROMIUMHelper(ClientBuffer buffer,
return image_id;
}
-GLuint GLES2Implementation::CreateImageCHROMIUM(ClientBuffer buffer,
+GLuint GLES2Implementation::CreateImageCHROMIUM(ClientBuffer* buffers,
GLsizei width,
GLsizei height,
GLenum internalformat) {
@@ -4751,7 +4758,7 @@ GLuint GLES2Implementation::CreateImageCHROMIUM(ClientBuffer buffer,
<< GLES2Util::GetStringImageInternalFormat(internalformat)
<< ")");
GLuint image_id =
- CreateImageCHROMIUMHelper(buffer, width, height, internalformat);
+ CreateImageCHROMIUMHelper(buffers, width, height, internalformat);
CheckGLError();
return image_id;
}

Powered by Google App Engine
This is Rietveld 408576698