| 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 "cc/ipc/cc_param_traits.h" | 5 #include "cc/ipc/cc_param_traits.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 void ParamTraits<cc::RenderPass>::Write(base::Pickle* m, const param_type& p) { | 324 void ParamTraits<cc::RenderPass>::Write(base::Pickle* m, const param_type& p) { |
| 325 WriteParam(m, p.id); | 325 WriteParam(m, p.id); |
| 326 WriteParam(m, p.output_rect); | 326 WriteParam(m, p.output_rect); |
| 327 WriteParam(m, p.damage_rect); | 327 WriteParam(m, p.damage_rect); |
| 328 WriteParam(m, p.transform_to_root_target); | 328 WriteParam(m, p.transform_to_root_target); |
| 329 WriteParam(m, p.filters); | 329 WriteParam(m, p.filters); |
| 330 WriteParam(m, p.background_filters); | 330 WriteParam(m, p.background_filters); |
| 331 WriteParam(m, p.color_space); | 331 WriteParam(m, p.color_space); |
| 332 WriteParam(m, p.has_transparent_background); | 332 WriteParam(m, p.has_transparent_background); |
| 333 WriteParam(m, p.force_render_surface); |
| 333 WriteParam(m, base::checked_cast<uint32_t>(p.quad_list.size())); | 334 WriteParam(m, base::checked_cast<uint32_t>(p.quad_list.size())); |
| 334 | 335 |
| 335 cc::SharedQuadStateList::ConstIterator shared_quad_state_iter = | 336 cc::SharedQuadStateList::ConstIterator shared_quad_state_iter = |
| 336 p.shared_quad_state_list.begin(); | 337 p.shared_quad_state_list.begin(); |
| 337 cc::SharedQuadStateList::ConstIterator last_shared_quad_state_iter = | 338 cc::SharedQuadStateList::ConstIterator last_shared_quad_state_iter = |
| 338 p.shared_quad_state_list.end(); | 339 p.shared_quad_state_list.end(); |
| 339 for (auto* quad : p.quad_list) { | 340 for (auto* quad : p.quad_list) { |
| 340 DCHECK(quad->rect.Contains(quad->visible_rect)) | 341 DCHECK(quad->rect.Contains(quad->visible_rect)) |
| 341 << quad->material << " rect: " << quad->rect.ToString() | 342 << quad->material << " rect: " << quad->rect.ToString() |
| 342 << " visible_rect: " << quad->visible_rect.ToString(); | 343 << " visible_rect: " << quad->visible_rect.ToString(); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 base::PickleIterator* iter, | 435 base::PickleIterator* iter, |
| 435 param_type* p) { | 436 param_type* p) { |
| 436 int id; | 437 int id; |
| 437 gfx::Rect output_rect; | 438 gfx::Rect output_rect; |
| 438 gfx::Rect damage_rect; | 439 gfx::Rect damage_rect; |
| 439 gfx::Transform transform_to_root_target; | 440 gfx::Transform transform_to_root_target; |
| 440 cc::FilterOperations filters; | 441 cc::FilterOperations filters; |
| 441 cc::FilterOperations background_filters; | 442 cc::FilterOperations background_filters; |
| 442 gfx::ColorSpace color_space; | 443 gfx::ColorSpace color_space; |
| 443 bool has_transparent_background; | 444 bool has_transparent_background; |
| 445 bool force_render_surface; |
| 444 uint32_t quad_list_size; | 446 uint32_t quad_list_size; |
| 445 | 447 |
| 446 if (!ReadParam(m, iter, &id) || !ReadParam(m, iter, &output_rect) || | 448 if (!ReadParam(m, iter, &id) || !ReadParam(m, iter, &output_rect) || |
| 447 !ReadParam(m, iter, &damage_rect) || | 449 !ReadParam(m, iter, &damage_rect) || |
| 448 !ReadParam(m, iter, &transform_to_root_target) || | 450 !ReadParam(m, iter, &transform_to_root_target) || |
| 449 !ReadParam(m, iter, &filters) || | 451 !ReadParam(m, iter, &filters) || |
| 450 !ReadParam(m, iter, &background_filters) || | 452 !ReadParam(m, iter, &background_filters) || |
| 451 !ReadParam(m, iter, &color_space) || | 453 !ReadParam(m, iter, &color_space) || |
| 452 !ReadParam(m, iter, &has_transparent_background) || | 454 !ReadParam(m, iter, &has_transparent_background) || |
| 455 !ReadParam(m, iter, &force_render_surface) || |
| 453 !ReadParam(m, iter, &quad_list_size)) | 456 !ReadParam(m, iter, &quad_list_size)) |
| 454 return false; | 457 return false; |
| 455 | 458 |
| 456 p->SetAll(id, output_rect, damage_rect, transform_to_root_target, filters, | 459 p->SetAll(id, output_rect, damage_rect, transform_to_root_target, filters, |
| 457 background_filters, color_space, has_transparent_background); | 460 background_filters, color_space, has_transparent_background, |
| 461 force_render_surface); |
| 458 | 462 |
| 459 cc::DrawQuad* last_draw_quad = nullptr; | 463 cc::DrawQuad* last_draw_quad = nullptr; |
| 460 for (uint32_t i = 0; i < quad_list_size; ++i) { | 464 for (uint32_t i = 0; i < quad_list_size; ++i) { |
| 461 cc::DrawQuad::Material material; | 465 cc::DrawQuad::Material material; |
| 462 base::PickleIterator temp_iter = *iter; | 466 base::PickleIterator temp_iter = *iter; |
| 463 if (!ReadParam(m, &temp_iter, &material)) | 467 if (!ReadParam(m, &temp_iter, &material)) |
| 464 return false; | 468 return false; |
| 465 | 469 |
| 466 cc::DrawQuad* draw_quad = nullptr; | 470 cc::DrawQuad* draw_quad = nullptr; |
| 467 switch (material) { | 471 switch (material) { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 LogParam(p.transform_to_root_target, l); | 566 LogParam(p.transform_to_root_target, l); |
| 563 l->append(", "); | 567 l->append(", "); |
| 564 LogParam(p.filters, l); | 568 LogParam(p.filters, l); |
| 565 l->append(", "); | 569 l->append(", "); |
| 566 LogParam(p.background_filters, l); | 570 LogParam(p.background_filters, l); |
| 567 l->append(", "); | 571 l->append(", "); |
| 568 LogParam(p.color_space, l); | 572 LogParam(p.color_space, l); |
| 569 l->append(", "); | 573 l->append(", "); |
| 570 LogParam(p.has_transparent_background, l); | 574 LogParam(p.has_transparent_background, l); |
| 571 l->append(", "); | 575 l->append(", "); |
| 576 LogParam(p.force_render_surface, l); |
| 577 l->append(", "); |
| 572 | 578 |
| 573 l->append("["); | 579 l->append("["); |
| 574 for (auto* shared_quad_state : p.shared_quad_state_list) { | 580 for (auto* shared_quad_state : p.shared_quad_state_list) { |
| 575 if (shared_quad_state != p.shared_quad_state_list.front()) | 581 if (shared_quad_state != p.shared_quad_state_list.front()) |
| 576 l->append(", "); | 582 l->append(", "); |
| 577 LogParam(*shared_quad_state, l); | 583 LogParam(*shared_quad_state, l); |
| 578 } | 584 } |
| 579 l->append("], ["); | 585 l->append("], ["); |
| 580 for (auto* quad : p.quad_list) { | 586 for (auto* quad : p.quad_list) { |
| 581 if (quad != p.quad_list.front()) | 587 if (quad != p.quad_list.front()) |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ | 1022 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ |
| 1017 #include "cc/ipc/cc_param_traits_macros.h" | 1023 #include "cc/ipc/cc_param_traits_macros.h" |
| 1018 } // namespace IPC | 1024 } // namespace IPC |
| 1019 | 1025 |
| 1020 // Generate param traits log methods. | 1026 // Generate param traits log methods. |
| 1021 #include "ipc/param_traits_log_macros.h" | 1027 #include "ipc/param_traits_log_macros.h" |
| 1022 namespace IPC { | 1028 namespace IPC { |
| 1023 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ | 1029 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ |
| 1024 #include "cc/ipc/cc_param_traits_macros.h" | 1030 #include "cc/ipc/cc_param_traits_macros.h" |
| 1025 } // namespace IPC | 1031 } // namespace IPC |
| OLD | NEW |