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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 9600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9611 image = ref->texture()->GetLevelImage(ref->texture()->target(), 0, | 9611 image = ref->texture()->GetLevelImage(ref->texture()->target(), 0, |
9612 &image_state); | 9612 &image_state); |
9613 if (!image || image_state != Texture::BOUND) { | 9613 if (!image || image_state != Texture::BOUND) { |
9614 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glScheduleCALayerCHROMIUM", | 9614 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glScheduleCALayerCHROMIUM", |
9615 "unsupported texture format"); | 9615 "unsupported texture format"); |
9616 return error::kNoError; | 9616 return error::kNoError; |
9617 } | 9617 } |
9618 } | 9618 } |
9619 | 9619 |
9620 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, | 9620 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, |
9621 22 * sizeof(GLfloat)); | 9621 28 * sizeof(GLfloat)); |
9622 if (!mem) { | 9622 if (!mem) { |
9623 return error::kOutOfBounds; | 9623 return error::kOutOfBounds; |
9624 } | 9624 } |
9625 gfx::RectF contents_rect(mem[0], mem[1], mem[2], mem[3]); | 9625 gfx::RectF contents_rect(mem[0], mem[1], mem[2], mem[3]); |
9626 gfx::SizeF bounds_size(mem[4], mem[5]); | 9626 gfx::RectF bounds_rect(mem[4], mem[5], mem[6], mem[7]); |
9627 gfx::Transform transform(mem[6], mem[10], mem[14], mem[18], | 9627 gfx::RectF clip_rect(mem[8], mem[9], mem[10], mem[11]); |
9628 mem[7], mem[11], mem[15], mem[19], | 9628 gfx::Transform transform(mem[12], mem[16], mem[20], mem[24], |
9629 mem[8], mem[12], mem[16], mem[20], | 9629 mem[13], mem[17], mem[21], mem[25], |
9630 mem[9], mem[13], mem[17], mem[21]); | 9630 mem[14], mem[18], mem[22], mem[26], |
| 9631 mem[15], mem[19], mem[23], mem[27]); |
9631 if (!surface_->ScheduleCALayer(image, contents_rect, c.opacity, | 9632 if (!surface_->ScheduleCALayer(image, contents_rect, c.opacity, |
9632 c.background_color, bounds_size, transform)) { | 9633 c.background_color, c.edge_aa_mask, |
| 9634 bounds_rect, c.is_clipped ? true : false, |
| 9635 clip_rect, transform)) { |
9633 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", | 9636 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", |
9634 "failed to schedule CALayer"); | 9637 "failed to schedule CALayer"); |
9635 } | 9638 } |
9636 return error::kNoError; | 9639 return error::kNoError; |
9637 } | 9640 } |
9638 | 9641 |
9639 error::Error GLES2DecoderImpl::GetAttribLocationHelper( | 9642 error::Error GLES2DecoderImpl::GetAttribLocationHelper( |
9640 GLuint client_id, uint32 location_shm_id, uint32 location_shm_offset, | 9643 GLuint client_id, uint32 location_shm_id, uint32 location_shm_offset, |
9641 const std::string& name_str) { | 9644 const std::string& name_str) { |
9642 if (!StringIsValidForGLES(name_str)) { | 9645 if (!StringIsValidForGLES(name_str)) { |
(...skipping 6142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15785 return error::kNoError; | 15788 return error::kNoError; |
15786 } | 15789 } |
15787 | 15790 |
15788 // Include the auto-generated part of this file. We split this because it means | 15791 // Include the auto-generated part of this file. We split this because it means |
15789 // we can easily edit the non-auto generated parts right here in this file | 15792 // we can easily edit the non-auto generated parts right here in this file |
15790 // instead of having to edit some template or the code generator. | 15793 // instead of having to edit some template or the code generator. |
15791 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15794 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
15792 | 15795 |
15793 } // namespace gles2 | 15796 } // namespace gles2 |
15794 } // namespace gpu | 15797 } // namespace gpu |
OLD | NEW |