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

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

Issue 2175043002: Add command buffer function glScheduleCALayerFilterEffectsCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: blah nits. Created 4 years, 5 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/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 6124 matching lines...) Expand 10 before | Expand all | Expand 10 after
6135 << "] glCreateGpuMemoryBufferImageCHROMIUM(" << width 6135 << "] glCreateGpuMemoryBufferImageCHROMIUM(" << width
6136 << ", " << height << ", " 6136 << ", " << height << ", "
6137 << GLES2Util::GetStringImageInternalFormat(internalformat) 6137 << GLES2Util::GetStringImageInternalFormat(internalformat)
6138 << ", " << GLES2Util::GetStringImageUsage(usage) << ")"); 6138 << ", " << GLES2Util::GetStringImageUsage(usage) << ")");
6139 GLuint image_id = CreateGpuMemoryBufferImageCHROMIUMHelper( 6139 GLuint image_id = CreateGpuMemoryBufferImageCHROMIUMHelper(
6140 width, height, internalformat, usage); 6140 width, height, internalformat, usage);
6141 CheckGLError(); 6141 CheckGLError();
6142 return image_id; 6142 return image_id;
6143 } 6143 }
6144 6144
6145 void GLES2Implementation::ScheduleCALayerFilterEffectsCHROMIUM(
6146 GLsizei count,
6147 const GLCALayerFilterEffect* effects) {
6148 GPU_CLIENT_SINGLE_THREAD_CHECK();
6149 GPU_CLIENT_LOG("[" << GetLogPrefix()
6150 << "] ScheduleCALayerFilterEffectsCHROMIUM(" << count
6151 << ", " << static_cast<const void*>(effects) << ")");
6152 GPU_CLIENT_LOG_CODE_BLOCK({
6153 for (GLsizei i = 0; i < count; ++i) {
6154 const GLCALayerFilterEffect& effect = effects[i];
6155 GPU_CLIENT_LOG(" " << i << ": " << effect.type << " " << effect.amount
6156 << " " << effect.drop_shadow_offset_x << " "
6157 << effect.drop_shadow_offset_y << " "
6158 << effect.drop_shadow_color);
6159 }
6160 });
6161 helper_->ScheduleCALayerFilterEffectsCHROMIUMImmediate(count, effects);
6162 CheckGLError();
6163 }
6164
6145 bool GLES2Implementation::ValidateSize(const char* func, GLsizeiptr size) { 6165 bool GLES2Implementation::ValidateSize(const char* func, GLsizeiptr size) {
6146 if (size < 0) { 6166 if (size < 0) {
6147 SetGLError(GL_INVALID_VALUE, func, "size < 0"); 6167 SetGLError(GL_INVALID_VALUE, func, "size < 0");
6148 return false; 6168 return false;
6149 } 6169 }
6150 if (!base::IsValueInRangeForNumericType<int32_t>(size)) { 6170 if (!base::IsValueInRangeForNumericType<int32_t>(size)) {
6151 SetGLError(GL_INVALID_OPERATION, func, "size more than 32-bit"); 6171 SetGLError(GL_INVALID_OPERATION, func, "size more than 32-bit");
6152 return false; 6172 return false;
6153 } 6173 }
6154 return true; 6174 return true;
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
6887 cached_extensions_.clear(); 6907 cached_extensions_.clear();
6888 } 6908 }
6889 6909
6890 // Include the auto-generated part of this file. We split this because it means 6910 // Include the auto-generated part of this file. We split this because it means
6891 // we can easily edit the non-auto generated parts right here in this file 6911 // we can easily edit the non-auto generated parts right here in this file
6892 // instead of having to edit some template or the code generator. 6912 // instead of having to edit some template or the code generator.
6893 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 6913 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
6894 6914
6895 } // namespace gles2 6915 } // namespace gles2
6896 } // namespace gpu 6916 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698