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