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

Side by Side Diff: content/common/cc_messages.cc

Issue 11618026: Move filters to RenderPassDrawQuad (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « content/common/cc_messages.h ('k') | content/common/cc_messages_unittest.cc » ('j') | 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) 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 "content/common/cc_messages.h" 5 #include "content/common/cc_messages.h"
6 6
7 #include "cc/compositor_frame.h" 7 #include "cc/compositor_frame.h"
8 #include "content/public/common/common_param_traits.h" 8 #include "content/public/common/common_param_traits.h"
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h"
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h" 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 288 }
289 289
290 void ParamTraits<cc::RenderPass>::Write( 290 void ParamTraits<cc::RenderPass>::Write(
291 Message* m, const param_type& p) { 291 Message* m, const param_type& p) {
292 WriteParam(m, p.id); 292 WriteParam(m, p.id);
293 WriteParam(m, p.output_rect); 293 WriteParam(m, p.output_rect);
294 WriteParam(m, p.damage_rect); 294 WriteParam(m, p.damage_rect);
295 WriteParam(m, p.transform_to_root_target); 295 WriteParam(m, p.transform_to_root_target);
296 WriteParam(m, p.has_transparent_background); 296 WriteParam(m, p.has_transparent_background);
297 WriteParam(m, p.has_occlusion_from_outside_target_surface); 297 WriteParam(m, p.has_occlusion_from_outside_target_surface);
298 WriteParam(m, p.filters);
299 // TODO(danakj): filter isn't being serialized.
300 WriteParam(m, p.background_filters);
301 WriteParam(m, p.shared_quad_state_list.size()); 298 WriteParam(m, p.shared_quad_state_list.size());
302 WriteParam(m, p.quad_list.size()); 299 WriteParam(m, p.quad_list.size());
303 300
304 for (size_t i = 0; i < p.shared_quad_state_list.size(); ++i) 301 for (size_t i = 0; i < p.shared_quad_state_list.size(); ++i)
305 WriteParam(m, *p.shared_quad_state_list[i]); 302 WriteParam(m, *p.shared_quad_state_list[i]);
306 303
307 size_t shared_quad_state_index = 0; 304 size_t shared_quad_state_index = 0;
308 for (size_t i = 0; i < p.quad_list.size(); ++i) { 305 for (size_t i = 0; i < p.quad_list.size(); ++i) {
309 const cc::DrawQuad* quad = p.quad_list[i]; 306 const cc::DrawQuad* quad = p.quad_list[i];
310 307
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 377 }
381 378
382 bool ParamTraits<cc::RenderPass>::Read( 379 bool ParamTraits<cc::RenderPass>::Read(
383 const Message* m, PickleIterator* iter, param_type* p) { 380 const Message* m, PickleIterator* iter, param_type* p) {
384 cc::RenderPass::Id id(-1, -1); 381 cc::RenderPass::Id id(-1, -1);
385 gfx::Rect output_rect; 382 gfx::Rect output_rect;
386 gfx::RectF damage_rect; 383 gfx::RectF damage_rect;
387 gfx::Transform transform_to_root_target; 384 gfx::Transform transform_to_root_target;
388 bool has_transparent_background; 385 bool has_transparent_background;
389 bool has_occlusion_from_outside_target_surface; 386 bool has_occlusion_from_outside_target_surface;
390 WebKit::WebFilterOperations filters;
391 skia::RefPtr<SkImageFilter> filter;
392 WebKit::WebFilterOperations background_filters;
393 size_t shared_quad_state_list_size; 387 size_t shared_quad_state_list_size;
394 size_t quad_list_size; 388 size_t quad_list_size;
395 389
396 if (!ReadParam(m, iter, &id) || 390 if (!ReadParam(m, iter, &id) ||
397 !ReadParam(m, iter, &output_rect) || 391 !ReadParam(m, iter, &output_rect) ||
398 !ReadParam(m, iter, &damage_rect) || 392 !ReadParam(m, iter, &damage_rect) ||
399 !ReadParam(m, iter, &transform_to_root_target) || 393 !ReadParam(m, iter, &transform_to_root_target) ||
400 !ReadParam(m, iter, &has_transparent_background) || 394 !ReadParam(m, iter, &has_transparent_background) ||
401 !ReadParam(m, iter, &has_occlusion_from_outside_target_surface) || 395 !ReadParam(m, iter, &has_occlusion_from_outside_target_surface) ||
402 !ReadParam(m, iter, &filters) ||
403 !ReadParam(m, iter, &background_filters) ||
404 !ReadParam(m, iter, &shared_quad_state_list_size) || 396 !ReadParam(m, iter, &shared_quad_state_list_size) ||
405 !ReadParam(m, iter, &quad_list_size)) 397 !ReadParam(m, iter, &quad_list_size))
406 return false; 398 return false;
407 399
408 p->SetAll(id, 400 p->SetAll(id,
409 output_rect, 401 output_rect,
410 damage_rect, 402 damage_rect,
411 transform_to_root_target, 403 transform_to_root_target,
412 has_transparent_background, 404 has_transparent_background,
413 has_occlusion_from_outside_target_surface, 405 has_occlusion_from_outside_target_surface);
414 filters,
415 filter, // TODO(danakj): filter isn't being serialized.
416 background_filters);
417 406
418 for (size_t i = 0; i < shared_quad_state_list_size; ++i) { 407 for (size_t i = 0; i < shared_quad_state_list_size; ++i) {
419 scoped_ptr<cc::SharedQuadState> state(cc::SharedQuadState::Create()); 408 scoped_ptr<cc::SharedQuadState> state(cc::SharedQuadState::Create());
420 if (!ReadParam(m, iter, state.get())) 409 if (!ReadParam(m, iter, state.get()))
421 return false; 410 return false;
422 p->shared_quad_state_list.append(state.Pass()); 411 p->shared_quad_state_list.append(state.Pass());
423 } 412 }
424 413
425 size_t last_shared_quad_state_index = 0; 414 size_t last_shared_quad_state_index = 0;
426 for (size_t i = 0; i < quad_list_size; ++i) { 415 for (size_t i = 0; i < quad_list_size; ++i) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 LogParam(p.output_rect, l); 479 LogParam(p.output_rect, l);
491 l->append(", "); 480 l->append(", ");
492 LogParam(p.damage_rect, l); 481 LogParam(p.damage_rect, l);
493 l->append(", "); 482 l->append(", ");
494 LogParam(p.transform_to_root_target, l); 483 LogParam(p.transform_to_root_target, l);
495 l->append(", "); 484 l->append(", ");
496 LogParam(p.has_transparent_background, l); 485 LogParam(p.has_transparent_background, l);
497 l->append(", "); 486 l->append(", ");
498 LogParam(p.has_occlusion_from_outside_target_surface, l); 487 LogParam(p.has_occlusion_from_outside_target_surface, l);
499 l->append(", "); 488 l->append(", ");
500 LogParam(p.filters, l);
501 l->append(", ");
502 // TODO(danakj): filter isn't being serialized.
503 LogParam(p.background_filters, l);
504 l->append(", ");
505 489
506 l->append("["); 490 l->append("[");
507 for (size_t i = 0; i < p.shared_quad_state_list.size(); ++i) { 491 for (size_t i = 0; i < p.shared_quad_state_list.size(); ++i) {
508 if (i) 492 if (i)
509 l->append(", "); 493 l->append(", ");
510 LogParam(*p.shared_quad_state_list[i], l); 494 LogParam(*p.shared_quad_state_list[i], l);
511 } 495 }
512 l->append("], ["); 496 l->append("], [");
513 for (size_t i = 0; i < p.quad_list.size(); ++i) { 497 for (size_t i = 0; i < p.quad_list.size(); ++i) {
514 if (i) 498 if (i)
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 l->append(", ["); 651 l->append(", [");
668 for (size_t i = 0; i < p.render_pass_list.size(); ++i) { 652 for (size_t i = 0; i < p.render_pass_list.size(); ++i) {
669 if (i) 653 if (i)
670 l->append(", "); 654 l->append(", ");
671 LogParam(*p.render_pass_list[i], l); 655 LogParam(*p.render_pass_list[i], l);
672 } 656 }
673 l->append("])"); 657 l->append("])");
674 } 658 }
675 659
676 } // namespace IPC 660 } // namespace IPC
OLDNEW
« no previous file with comments | « content/common/cc_messages.h ('k') | content/common/cc_messages_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698