| 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 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 error::Error error = DoScheduleCALayerCHROMIUM( | 1934 error::Error error = DoScheduleCALayerCHROMIUM( |
| 1935 contents_texture_id, contents_rect, opacity, background_color, | 1935 contents_texture_id, contents_rect, opacity, background_color, |
| 1936 edge_aa_mask, bounds_rect, is_clipped, clip_rect, sorting_context_id, | 1936 edge_aa_mask, bounds_rect, is_clipped, clip_rect, sorting_context_id, |
| 1937 transform); | 1937 transform); |
| 1938 if (error != error::kNoError) { | 1938 if (error != error::kNoError) { |
| 1939 return error; | 1939 return error; |
| 1940 } | 1940 } |
| 1941 return error::kNoError; | 1941 return error::kNoError; |
| 1942 } | 1942 } |
| 1943 | 1943 |
| 1944 error::Error |
| 1945 GLES2DecoderPassthroughImpl::HandleScheduleCALayerInUseQueryCHROMIUMImmediate( |
| 1946 uint32_t immediate_data_size, |
| 1947 const void* cmd_data) { |
| 1948 const gles2::cmds::ScheduleCALayerInUseQueryCHROMIUMImmediate& c = |
| 1949 *static_cast< |
| 1950 const gles2::cmds::ScheduleCALayerInUseQueryCHROMIUMImmediate*>( |
| 1951 cmd_data); |
| 1952 |
| 1953 GLuint n = static_cast<GLuint>(c.n); |
| 1954 uint32_t data_size; |
| 1955 if (!GLES2Util::ComputeDataSize(n, sizeof(GLuint), 1, &data_size)) { |
| 1956 return error::kOutOfBounds; |
| 1957 } |
| 1958 if (data_size > immediate_data_size) { |
| 1959 return error::kOutOfBounds; |
| 1960 } |
| 1961 const GLuint* textures = |
| 1962 GetImmediateDataAs<const GLuint*>(c, data_size, immediate_data_size); |
| 1963 return DoScheduleCALayerInUseQueryCHROMIUM(n, textures); |
| 1964 } |
| 1965 |
| 1944 error::Error GLES2DecoderPassthroughImpl::HandleGenPathsCHROMIUM( | 1966 error::Error GLES2DecoderPassthroughImpl::HandleGenPathsCHROMIUM( |
| 1945 uint32_t immediate_data_size, | 1967 uint32_t immediate_data_size, |
| 1946 const void* cmd_data) { | 1968 const void* cmd_data) { |
| 1947 const gles2::cmds::GenPathsCHROMIUM& c = | 1969 const gles2::cmds::GenPathsCHROMIUM& c = |
| 1948 *static_cast<const gles2::cmds::GenPathsCHROMIUM*>(cmd_data); | 1970 *static_cast<const gles2::cmds::GenPathsCHROMIUM*>(cmd_data); |
| 1949 GLuint path = static_cast<GLuint>(c.first_client_id); | 1971 GLuint path = static_cast<GLuint>(c.first_client_id); |
| 1950 GLsizei range = static_cast<GLsizei>(c.range); | 1972 GLsizei range = static_cast<GLsizei>(c.range); |
| 1951 error::Error error = DoGenPathsCHROMIUM(path, range); | 1973 error::Error error = DoGenPathsCHROMIUM(path, range); |
| 1952 if (error != error::kNoError) { | 1974 if (error != error::kNoError) { |
| 1953 return error; | 1975 return error; |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2581 } | 2603 } |
| 2582 error::Error error = DoGetFragDataIndexEXT(program, name_str.c_str(), index); | 2604 error::Error error = DoGetFragDataIndexEXT(program, name_str.c_str(), index); |
| 2583 if (error != error::kNoError) { | 2605 if (error != error::kNoError) { |
| 2584 return error; | 2606 return error; |
| 2585 } | 2607 } |
| 2586 return error::kNoError; | 2608 return error::kNoError; |
| 2587 } | 2609 } |
| 2588 | 2610 |
| 2589 } // namespace gles2 | 2611 } // namespace gles2 |
| 2590 } // namespace gpu | 2612 } // namespace gpu |
| OLD | NEW |