| OLD | NEW |
| 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 2256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2267 } | 2267 } |
| 2268 | 2268 |
| 2269 namespace { | 2269 namespace { |
| 2270 | 2270 |
| 2271 void CopyRectToBuffer(const void* pixels, | 2271 void CopyRectToBuffer(const void* pixels, |
| 2272 uint32_t height, | 2272 uint32_t height, |
| 2273 uint32_t unpadded_row_size, | 2273 uint32_t unpadded_row_size, |
| 2274 uint32_t pixels_padded_row_size, | 2274 uint32_t pixels_padded_row_size, |
| 2275 void* buffer, | 2275 void* buffer, |
| 2276 uint32_t buffer_padded_row_size) { | 2276 uint32_t buffer_padded_row_size) { |
| 2277 if (height == 0) |
| 2278 return; |
| 2277 const int8_t* source = static_cast<const int8_t*>(pixels); | 2279 const int8_t* source = static_cast<const int8_t*>(pixels); |
| 2278 int8_t* dest = static_cast<int8_t*>(buffer); | 2280 int8_t* dest = static_cast<int8_t*>(buffer); |
| 2279 if (pixels_padded_row_size != buffer_padded_row_size) { | 2281 if (pixels_padded_row_size != buffer_padded_row_size) { |
| 2280 // the last row is copied unpadded at the end | 2282 // the last row is copied unpadded at the end |
| 2281 for (; height > 1; --height) { | 2283 for (; height > 1; --height) { |
| 2282 memcpy(dest, source, buffer_padded_row_size); | 2284 memcpy(dest, source, buffer_padded_row_size); |
| 2283 dest += buffer_padded_row_size; | 2285 dest += buffer_padded_row_size; |
| 2284 source += pixels_padded_row_size; | 2286 source += pixels_padded_row_size; |
| 2285 } | 2287 } |
| 2286 memcpy(dest, source, unpadded_row_size); | 2288 memcpy(dest, source, unpadded_row_size); |
| (...skipping 4260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6547 CheckGLError(); | 6549 CheckGLError(); |
| 6548 } | 6550 } |
| 6549 | 6551 |
| 6550 // Include the auto-generated part of this file. We split this because it means | 6552 // Include the auto-generated part of this file. We split this because it means |
| 6551 // we can easily edit the non-auto generated parts right here in this file | 6553 // we can easily edit the non-auto generated parts right here in this file |
| 6552 // instead of having to edit some template or the code generator. | 6554 // instead of having to edit some template or the code generator. |
| 6553 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6555 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 6554 | 6556 |
| 6555 } // namespace gles2 | 6557 } // namespace gles2 |
| 6556 } // namespace gpu | 6558 } // namespace gpu |
| OLD | NEW |