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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc

Issue 2163493002: Break glScheduleCALayerCHROMIUM into smaller functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp37_cleanup_calayeroverlay
Patch Set: Comments from piman. 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 GLfloat uv_height = static_cast<GLfloat>(c.uv_x); 1719 GLfloat uv_height = static_cast<GLfloat>(c.uv_x);
1720 error::Error error = DoScheduleOverlayPlaneCHROMIUM( 1720 error::Error error = DoScheduleOverlayPlaneCHROMIUM(
1721 plane_z_order, plane_transform, overlay_texture_id, bounds_x, bounds_y, 1721 plane_z_order, plane_transform, overlay_texture_id, bounds_x, bounds_y,
1722 bounds_width, bounds_height, uv_x, uv_y, uv_width, uv_height); 1722 bounds_width, bounds_height, uv_x, uv_y, uv_width, uv_height);
1723 if (error != error::kNoError) { 1723 if (error != error::kNoError) {
1724 return error; 1724 return error;
1725 } 1725 }
1726 return error::kNoError; 1726 return error::kNoError;
1727 } 1727 }
1728 1728
1729 error::Error
1730 GLES2DecoderPassthroughImpl::HandleScheduleCALayerSharedStateCHROMIUM(
1731 uint32_t immediate_data_size,
1732 const void* cmd_data) {
1733 const gles2::cmds::ScheduleCALayerSharedStateCHROMIUM& c =
1734 *static_cast<const gles2::cmds::ScheduleCALayerSharedStateCHROMIUM*>(
1735 cmd_data);
1736 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset,
1737 20 * sizeof(GLfloat));
1738 if (!mem) {
1739 return error::kOutOfBounds;
1740 }
1741 GLfloat opacity = static_cast<GLfloat>(c.opacity);
1742 GLboolean is_clipped = static_cast<GLboolean>(c.is_clipped);
1743 const GLfloat* clip_rect = mem + 0;
1744 GLint sorting_context_id = static_cast<GLint>(c.sorting_context_id);
1745 const GLfloat* transform = mem + 4;
1746 error::Error error = DoScheduleCALayerSharedStateCHROMIUM(
1747 opacity, is_clipped, clip_rect, sorting_context_id, transform);
1748 if (error != error::kNoError) {
1749 return error;
1750 }
1751 return error::kNoError;
1752 }
1753
1729 error::Error GLES2DecoderPassthroughImpl::HandleScheduleCALayerCHROMIUM( 1754 error::Error GLES2DecoderPassthroughImpl::HandleScheduleCALayerCHROMIUM(
1730 uint32_t immediate_data_size, 1755 uint32_t immediate_data_size,
1731 const void* cmd_data) { 1756 const void* cmd_data) {
1732 const gles2::cmds::ScheduleCALayerCHROMIUM& c = 1757 const gles2::cmds::ScheduleCALayerCHROMIUM& c =
1733 *static_cast<const gles2::cmds::ScheduleCALayerCHROMIUM*>(cmd_data); 1758 *static_cast<const gles2::cmds::ScheduleCALayerCHROMIUM*>(cmd_data);
1734 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, 1759 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset,
1735 28 * sizeof(GLfloat)); 1760 8 * sizeof(GLfloat));
1736 if (!mem) { 1761 if (!mem) {
1737 return error::kOutOfBounds; 1762 return error::kOutOfBounds;
1738 } 1763 }
1739 GLuint contents_texture_id = static_cast<GLint>(c.contents_texture_id); 1764 GLuint contents_texture_id = static_cast<GLint>(c.contents_texture_id);
1740 const GLfloat* contents_rect = mem; 1765 const GLfloat* contents_rect = mem;
1741 GLfloat opacity = static_cast<GLfloat>(c.opacity);
1742 GLuint background_color = static_cast<GLuint>(c.background_color); 1766 GLuint background_color = static_cast<GLuint>(c.background_color);
1743 GLuint edge_aa_mask = static_cast<GLuint>(c.edge_aa_mask); 1767 GLuint edge_aa_mask = static_cast<GLuint>(c.edge_aa_mask);
1744 const GLfloat* bounds_rect = mem + 4; 1768 const GLfloat* bounds_rect = mem + 4;
1745 GLboolean is_clipped = static_cast<GLboolean>(c.is_clipped); 1769 error::Error error =
1746 const GLfloat* clip_rect = mem + 8; 1770 DoScheduleCALayerCHROMIUM(contents_texture_id, contents_rect,
1747 GLint sorting_context_id = static_cast<GLint>(c.sorting_context_id); 1771 background_color, edge_aa_mask, bounds_rect);
1748 const GLfloat* transform = mem + 12;
1749 error::Error error = DoScheduleCALayerCHROMIUM(
1750 contents_texture_id, contents_rect, opacity, background_color,
1751 edge_aa_mask, bounds_rect, is_clipped, clip_rect, sorting_context_id,
1752 transform);
1753 if (error != error::kNoError) { 1772 if (error != error::kNoError) {
1754 return error; 1773 return error;
1755 } 1774 }
1756 return error::kNoError; 1775 return error::kNoError;
1757 } 1776 }
1758 1777
1759 error::Error GLES2DecoderPassthroughImpl::HandleGenPathsCHROMIUM( 1778 error::Error GLES2DecoderPassthroughImpl::HandleGenPathsCHROMIUM(
1760 uint32_t immediate_data_size, 1779 uint32_t immediate_data_size,
1761 const void* cmd_data) { 1780 const void* cmd_data) {
1762 const gles2::cmds::GenPathsCHROMIUM& c = 1781 const gles2::cmds::GenPathsCHROMIUM& c =
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 } 2415 }
2397 error::Error error = DoGetFragDataIndexEXT(program, name_str.c_str(), index); 2416 error::Error error = DoGetFragDataIndexEXT(program, name_str.c_str(), index);
2398 if (error != error::kNoError) { 2417 if (error != error::kNoError) {
2399 return error; 2418 return error;
2400 } 2419 }
2401 return error::kNoError; 2420 return error::kNoError;
2402 } 2421 }
2403 2422
2404 } // namespace gles2 2423 } // namespace gles2
2405 } // namespace gpu 2424 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698