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