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

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

Issue 12378053: Move Mailbox from cc to gpu, and its traits to gpu/ipc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ios hate Created 7 years, 9 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 | 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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 case cc::DrawQuad::YUV_VIDEO_CONTENT: 529 case cc::DrawQuad::YUV_VIDEO_CONTENT:
530 LogParam(*cc::YUVVideoDrawQuad::MaterialCast(quad), l); 530 LogParam(*cc::YUVVideoDrawQuad::MaterialCast(quad), l);
531 break; 531 break;
532 case cc::DrawQuad::INVALID: 532 case cc::DrawQuad::INVALID:
533 break; 533 break;
534 } 534 }
535 } 535 }
536 l->append("])"); 536 l->append("])");
537 } 537 }
538 538
539 void ParamTraits<cc::Mailbox>::Write(Message* m, const param_type& p) {
540 m->WriteBytes(p.name, sizeof(p.name));
541 }
542
543 bool ParamTraits<cc::Mailbox>::Read(const Message* m,
544 PickleIterator* iter,
545 param_type* p) {
546 const char* bytes = NULL;
547 if (!m->ReadBytes(iter, &bytes, sizeof(p->name)))
548 return false;
549 DCHECK(bytes);
550 memcpy(p->name, bytes, sizeof(p->name));
551 return true;
552 }
553
554 void ParamTraits<cc::Mailbox>::Log(const param_type& p, std::string* l) {
555 for (size_t i = 0; i < sizeof(p.name); ++i)
556 *l += base::StringPrintf("%02x", p.name[i]);
557 }
558
559 namespace { 539 namespace {
560 enum CompositorFrameType { 540 enum CompositorFrameType {
561 NO_FRAME, 541 NO_FRAME,
562 DELEGATED_FRAME, 542 DELEGATED_FRAME,
563 GL_FRAME, 543 GL_FRAME,
564 }; 544 };
565 } 545 }
566 546
567 void ParamTraits<cc::CompositorFrame>::Write(Message* m, 547 void ParamTraits<cc::CompositorFrame>::Write(Message* m,
568 const param_type& p) { 548 const param_type& p) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 l->append(", ["); 679 l->append(", [");
700 for (size_t i = 0; i < p.render_pass_list.size(); ++i) { 680 for (size_t i = 0; i < p.render_pass_list.size(); ++i) {
701 if (i) 681 if (i)
702 l->append(", "); 682 l->append(", ");
703 LogParam(*p.render_pass_list[i], l); 683 LogParam(*p.render_pass_list[i], l);
704 } 684 }
705 l->append("])"); 685 l->append("])");
706 } 686 }
707 687
708 } // namespace IPC 688 } // 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