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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 184233002: Fix the issue that it may get wrong stride in cc::ResourceProvider::MapImage. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove platform-specific comments and generate a GL_INVALID_OPERATION Created 6 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
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 3890 matching lines...) Expand 10 before | Expand all | Expand 10 after
3901 } 3901 }
3902 3902
3903 gfx::GpuMemoryBuffer* gpu_buffer = gpu_memory_buffer_tracker_->GetBuffer( 3903 gfx::GpuMemoryBuffer* gpu_buffer = gpu_memory_buffer_tracker_->GetBuffer(
3904 image_id); 3904 image_id);
3905 if (!gpu_buffer) { 3905 if (!gpu_buffer) {
3906 SetGLError(GL_INVALID_OPERATION, "glGetImageParameterivCHROMIUM", 3906 SetGLError(GL_INVALID_OPERATION, "glGetImageParameterivCHROMIUM",
3907 "invalid image"); 3907 "invalid image");
3908 return; 3908 return;
3909 } 3909 }
3910 3910
3911 if (!gpu_buffer->IsMapped()) {
3912 SetGLError(GL_INVALID_OPERATION, "glGetImageParameterivCHROMIUM",
3913 "MapImageCHROMIUM should be called prior to GetImageParameterivCHROMIUM");
reveman 2014/03/04 15:17:31 nit: "not mapped" is enough. also please use "git
junj 2014/03/05 07:50:57 Done.
3914 return;
3915 }
3916
3911 *params = gpu_buffer->GetStride(); 3917 *params = gpu_buffer->GetStride();
3912 } 3918 }
3913 3919
3914 void GLES2Implementation::GetImageParameterivCHROMIUM( 3920 void GLES2Implementation::GetImageParameterivCHROMIUM(
3915 GLuint image_id, GLenum pname, GLint* params) { 3921 GLuint image_id, GLenum pname, GLint* params) {
3916 GPU_CLIENT_SINGLE_THREAD_CHECK(); 3922 GPU_CLIENT_SINGLE_THREAD_CHECK();
3917 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params); 3923 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(GLint, params);
3918 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glImageParameterivCHROMIUM(" 3924 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glImageParameterivCHROMIUM("
3919 << image_id << ", " 3925 << image_id << ", "
3920 << GLES2Util::GetStringBufferParameter(pname) << ", " 3926 << GLES2Util::GetStringBufferParameter(pname) << ", "
3921 << static_cast<const void*>(params) << ")"); 3927 << static_cast<const void*>(params) << ")");
3922 GetImageParameterivCHROMIUMHelper(image_id, pname, params); 3928 GetImageParameterivCHROMIUMHelper(image_id, pname, params);
3923 CheckGLError(); 3929 CheckGLError();
3924 } 3930 }
3925 3931
3926 // Include the auto-generated part of this file. We split this because it means 3932 // Include the auto-generated part of this file. We split this because it means
3927 // we can easily edit the non-auto generated parts right here in this file 3933 // we can easily edit the non-auto generated parts right here in this file
3928 // instead of having to edit some template or the code generator. 3934 // instead of having to edit some template or the code generator.
3929 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 3935 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
3930 3936
3931 } // namespace gles2 3937 } // namespace gles2
3932 } // namespace gpu 3938 } // namespace gpu
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698