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

Side by Side 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: Handle through IPC. Created 5 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 (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 // A class to emulate GLES2 over command buffers. 5 // A class to emulate GLES2 over command buffers.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2ext.h> 9 #include <GLES2/gl2ext.h>
10 #include <GLES2/gl2extchromium.h> 10 #include <GLES2/gl2extchromium.h>
(...skipping 4695 matching lines...) Expand 10 before | Expand all | Expand 10 after
4706 case GL_MAP_CHROMIUM: 4706 case GL_MAP_CHROMIUM:
4707 case GL_SCANOUT_CHROMIUM: 4707 case GL_SCANOUT_CHROMIUM:
4708 return true; 4708 return true;
4709 default: 4709 default:
4710 return false; 4710 return false;
4711 } 4711 }
4712 } 4712 }
4713 4713
4714 } // namespace 4714 } // namespace
4715 4715
4716 GLuint GLES2Implementation::CreateImageCHROMIUMHelper(ClientBuffer buffer, 4716 GLuint GLES2Implementation::CreateImageCHROMIUMHelper(
4717 GLsizei width, 4717 ClientBuffer* const buffers,
4718 GLsizei height, 4718 GLsizei width,
4719 GLenum internalformat) { 4719 GLsizei height,
4720 GLenum internalformat) {
4720 if (width <= 0) { 4721 if (width <= 0) {
4721 SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "width <= 0"); 4722 SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "width <= 0");
4722 return 0; 4723 return 0;
4723 } 4724 }
4724 4725
4725 if (height <= 0) { 4726 if (height <= 0) {
4726 SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "height <= 0"); 4727 SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "height <= 0");
4727 return 0; 4728 return 0;
4728 } 4729 }
4729 4730
4730 if (!ValidImageFormat(internalformat)) { 4731 if (!ValidImageFormat(internalformat)) {
4731 SetGLError(GL_INVALID_VALUE, "glCreateImageCHROMIUM", "invalid format"); 4732 SetGLError(GL_INVALID_ENUM, "glCreateImageCHROMIUM", "invalid format");
4732 return 0; 4733 return 0;
4733 } 4734 }
4734 4735
4735 int32_t image_id = 4736 int32_t image_id =
4736 gpu_control_->CreateImage(buffer, width, height, internalformat); 4737 gpu_control_->CreateImage(buffers, width, height, internalformat);
4737 if (image_id < 0) { 4738 if (image_id < 0) {
4738 SetGLError(GL_OUT_OF_MEMORY, "glCreateImageCHROMIUM", "image_id < 0"); 4739 SetGLError(GL_OUT_OF_MEMORY, "glCreateImageCHROMIUM", "image_id < 0");
4739 return 0; 4740 return 0;
4740 } 4741 }
4741 return image_id; 4742 return image_id;
4742 } 4743 }
4743 4744
4744 GLuint GLES2Implementation::CreateImageCHROMIUM(ClientBuffer buffer, 4745 GLuint GLES2Implementation::CreateImageCHROMIUM(
4745 GLsizei width, 4746 ClientBuffer* buffers,
4746 GLsizei height, 4747 GLsizei width,
4747 GLenum internalformat) { 4748 GLsizei height,
4749 GLenum internalformat) {
4748 GPU_CLIENT_SINGLE_THREAD_CHECK(); 4750 GPU_CLIENT_SINGLE_THREAD_CHECK();
4749 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateImageCHROMIUM(" << width 4751 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateImageCHROMIUM(" << width
4750 << ", " << height << ", " 4752 << ", " << height << ", "
4751 << GLES2Util::GetStringImageInternalFormat(internalformat) 4753 << GLES2Util::GetStringImageInternalFormat(internalformat)
4752 << ")"); 4754 << ")");
4753 GLuint image_id = 4755 GLuint image_id =
4754 CreateImageCHROMIUMHelper(buffer, width, height, internalformat); 4756 CreateImageCHROMIUMHelper(buffers, width, height, internalformat);
4755 CheckGLError(); 4757 CheckGLError();
4756 return image_id; 4758 return image_id;
4757 } 4759 }
4758 4760
4759 void GLES2Implementation::DestroyImageCHROMIUMHelper(GLuint image_id) { 4761 void GLES2Implementation::DestroyImageCHROMIUMHelper(GLuint image_id) {
4760 // Flush the command stream to make sure all pending commands 4762 // Flush the command stream to make sure all pending commands
4761 // that may refer to the image_id are executed on the service side. 4763 // that may refer to the image_id are executed on the service side.
4762 helper_->CommandBufferHelper::Flush(); 4764 helper_->CommandBufferHelper::Flush();
4763 gpu_control_->DestroyImage(image_id); 4765 gpu_control_->DestroyImage(image_id);
4764 } 4766 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
4991 CheckGLError(); 4993 CheckGLError();
4992 } 4994 }
4993 4995
4994 // Include the auto-generated part of this file. We split this because it means 4996 // Include the auto-generated part of this file. We split this because it means
4995 // we can easily edit the non-auto generated parts right here in this file 4997 // we can easily edit the non-auto generated parts right here in this file
4996 // instead of having to edit some template or the code generator. 4998 // instead of having to edit some template or the code generator.
4997 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 4999 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
4998 5000
4999 } // namespace gles2 5001 } // namespace gles2
5000 } // namespace gpu 5002 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698