OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_passthrough.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" |
6 | 6 |
7 namespace gpu { | 7 namespace gpu { |
8 namespace gles2 { | 8 namespace gles2 { |
9 | 9 |
10 // Custom Handlers | 10 // Custom Handlers |
(...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 const GLfloat* bounds_rect = mem + 4; | 1788 const GLfloat* bounds_rect = mem + 4; |
1789 error::Error error = | 1789 error::Error error = |
1790 DoScheduleCALayerCHROMIUM(contents_texture_id, contents_rect, | 1790 DoScheduleCALayerCHROMIUM(contents_texture_id, contents_rect, |
1791 background_color, edge_aa_mask, bounds_rect); | 1791 background_color, edge_aa_mask, bounds_rect); |
1792 if (error != error::kNoError) { | 1792 if (error != error::kNoError) { |
1793 return error; | 1793 return error; |
1794 } | 1794 } |
1795 return error::kNoError; | 1795 return error::kNoError; |
1796 } | 1796 } |
1797 | 1797 |
| 1798 error::Error |
| 1799 GLES2DecoderPassthroughImpl::HandleScheduleDCLayerSharedStateCHROMIUM( |
| 1800 uint32_t immediate_data_size, |
| 1801 const volatile void* cmd_data) { |
| 1802 const volatile gles2::cmds::ScheduleDCLayerSharedStateCHROMIUM& c = |
| 1803 *static_cast< |
| 1804 const volatile gles2::cmds::ScheduleDCLayerSharedStateCHROMIUM*>( |
| 1805 cmd_data); |
| 1806 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, |
| 1807 20 * sizeof(GLfloat)); |
| 1808 if (!mem) { |
| 1809 return error::kOutOfBounds; |
| 1810 } |
| 1811 GLfloat opacity = static_cast<GLfloat>(c.opacity); |
| 1812 GLboolean is_clipped = static_cast<GLboolean>(c.is_clipped); |
| 1813 const GLfloat* clip_rect = mem + 0; |
| 1814 GLint z_order = static_cast<GLint>(c.z_order); |
| 1815 const GLfloat* transform = mem + 4; |
| 1816 error::Error error = DoScheduleDCLayerSharedStateCHROMIUM( |
| 1817 opacity, is_clipped, clip_rect, z_order, transform); |
| 1818 if (error != error::kNoError) { |
| 1819 return error; |
| 1820 } |
| 1821 return error::kNoError; |
| 1822 } |
| 1823 |
| 1824 error::Error GLES2DecoderPassthroughImpl::HandleScheduleDCLayerCHROMIUM( |
| 1825 uint32_t immediate_data_size, |
| 1826 const volatile void* cmd_data) { |
| 1827 const volatile gles2::cmds::ScheduleDCLayerCHROMIUM& c = |
| 1828 *static_cast<const volatile gles2::cmds::ScheduleDCLayerCHROMIUM*>( |
| 1829 cmd_data); |
| 1830 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, |
| 1831 8 * sizeof(GLfloat)); |
| 1832 if (!mem) { |
| 1833 return error::kOutOfBounds; |
| 1834 } |
| 1835 GLuint contents_texture_id = static_cast<GLint>(c.contents_texture_id); |
| 1836 const GLfloat* contents_rect = mem; |
| 1837 GLuint background_color = static_cast<GLuint>(c.background_color); |
| 1838 GLuint edge_aa_mask = static_cast<GLuint>(c.edge_aa_mask); |
| 1839 const GLfloat* bounds_rect = mem + 4; |
| 1840 error::Error error = |
| 1841 DoScheduleDCLayerCHROMIUM(contents_texture_id, contents_rect, |
| 1842 background_color, edge_aa_mask, bounds_rect); |
| 1843 if (error != error::kNoError) { |
| 1844 return error; |
| 1845 } |
| 1846 return error::kNoError; |
| 1847 } |
| 1848 |
1798 error::Error GLES2DecoderPassthroughImpl::HandleGenPathsCHROMIUM( | 1849 error::Error GLES2DecoderPassthroughImpl::HandleGenPathsCHROMIUM( |
1799 uint32_t immediate_data_size, | 1850 uint32_t immediate_data_size, |
1800 const volatile void* cmd_data) { | 1851 const volatile void* cmd_data) { |
1801 const volatile gles2::cmds::GenPathsCHROMIUM& c = | 1852 const volatile gles2::cmds::GenPathsCHROMIUM& c = |
1802 *static_cast<const volatile gles2::cmds::GenPathsCHROMIUM*>(cmd_data); | 1853 *static_cast<const volatile gles2::cmds::GenPathsCHROMIUM*>(cmd_data); |
1803 GLuint path = static_cast<GLuint>(c.first_client_id); | 1854 GLuint path = static_cast<GLuint>(c.first_client_id); |
1804 GLsizei range = static_cast<GLsizei>(c.range); | 1855 GLsizei range = static_cast<GLsizei>(c.range); |
1805 error::Error error = DoGenPathsCHROMIUM(path, range); | 1856 error::Error error = DoGenPathsCHROMIUM(path, range); |
1806 if (error != error::kNoError) { | 1857 if (error != error::kNoError) { |
1807 return error; | 1858 return error; |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 // TODO(geofflang): Handle PIXEL_UNPACK_BUFFER case. | 2673 // TODO(geofflang): Handle PIXEL_UNPACK_BUFFER case. |
2623 const void* data = GetSharedMemoryAs<const void*>( | 2674 const void* data = GetSharedMemoryAs<const void*>( |
2624 c.data_shm_id, c.data_shm_offset, image_size); | 2675 c.data_shm_id, c.data_shm_offset, image_size); |
2625 return DoCompressedTexSubImage3D( | 2676 return DoCompressedTexSubImage3D( |
2626 target, level, xoffset, yoffset, zoffset, width, height, depth, | 2677 target, level, xoffset, yoffset, zoffset, width, height, depth, |
2627 format, image_size, data); | 2678 format, image_size, data); |
2628 } | 2679 } |
2629 | 2680 |
2630 } // namespace gles2 | 2681 } // namespace gles2 |
2631 } // namespace gpu | 2682 } // namespace gpu |
OLD | NEW |