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 "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 22 matching lines...) Expand all Loading... |
33 WriteParam(m, p.dropShadowColor()); | 33 WriteParam(m, p.dropShadowColor()); |
34 break; | 34 break; |
35 case WebKit::WebFilterOperation::FilterTypeColorMatrix: | 35 case WebKit::WebFilterOperation::FilterTypeColorMatrix: |
36 for (int i = 0; i < 20; ++i) | 36 for (int i = 0; i < 20; ++i) |
37 WriteParam(m, p.matrix()[i]); | 37 WriteParam(m, p.matrix()[i]); |
38 break; | 38 break; |
39 case WebKit::WebFilterOperation::FilterTypeZoom: | 39 case WebKit::WebFilterOperation::FilterTypeZoom: |
40 WriteParam(m, p.zoomRect()); | 40 WriteParam(m, p.zoomRect()); |
41 WriteParam(m, p.amount()); | 41 WriteParam(m, p.amount()); |
42 break; | 42 break; |
| 43 default: |
| 44 // FIXME: temporary place holder to prevent build failures |
| 45 // (pending a new FilterType). |
| 46 NOTREACHED(); |
| 47 break; |
43 } | 48 } |
44 } | 49 } |
45 | 50 |
46 bool ParamTraits<WebKit::WebFilterOperation>::Read( | 51 bool ParamTraits<WebKit::WebFilterOperation>::Read( |
47 const Message* m, PickleIterator* iter, param_type* r) { | 52 const Message* m, PickleIterator* iter, param_type* r) { |
48 WebKit::WebFilterOperation::FilterType type; | 53 WebKit::WebFilterOperation::FilterType type; |
49 float amount; | 54 float amount; |
50 WebKit::WebPoint dropShadowOffset; | 55 WebKit::WebPoint dropShadowOffset; |
51 WebKit::WebColor dropShadowColor; | 56 WebKit::WebColor dropShadowColor; |
52 SkScalar matrix[20]; | 57 SkScalar matrix[20]; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 break; | 100 break; |
96 } | 101 } |
97 case WebKit::WebFilterOperation::FilterTypeZoom: | 102 case WebKit::WebFilterOperation::FilterTypeZoom: |
98 if (ReadParam(m, iter, &zoomRect) && | 103 if (ReadParam(m, iter, &zoomRect) && |
99 ReadParam(m, iter, &amount)) { | 104 ReadParam(m, iter, &amount)) { |
100 r->setZoomRect(zoomRect); | 105 r->setZoomRect(zoomRect); |
101 r->setAmount(amount); | 106 r->setAmount(amount); |
102 success = true; | 107 success = true; |
103 } | 108 } |
104 break; | 109 break; |
| 110 default: |
| 111 // FIXME: temporary place holder to prevent build failures |
| 112 // (pending a new FilterType). |
| 113 NOTREACHED(); |
| 114 break; |
105 } | 115 } |
106 return success; | 116 return success; |
107 } | 117 } |
108 | 118 |
109 void ParamTraits<WebKit::WebFilterOperation>::Log( | 119 void ParamTraits<WebKit::WebFilterOperation>::Log( |
110 const param_type& p, std::string* l) { | 120 const param_type& p, std::string* l) { |
111 l->append("("); | 121 l->append("("); |
112 LogParam(static_cast<unsigned>(p.type()), l); | 122 LogParam(static_cast<unsigned>(p.type()), l); |
113 l->append(", "); | 123 l->append(", "); |
114 | 124 |
(...skipping 21 matching lines...) Expand all Loading... |
136 if (i) | 146 if (i) |
137 l->append(", "); | 147 l->append(", "); |
138 LogParam(p.matrix()[i], l); | 148 LogParam(p.matrix()[i], l); |
139 } | 149 } |
140 break; | 150 break; |
141 case WebKit::WebFilterOperation::FilterTypeZoom: | 151 case WebKit::WebFilterOperation::FilterTypeZoom: |
142 LogParam(p.zoomRect(), l); | 152 LogParam(p.zoomRect(), l); |
143 l->append(", "); | 153 l->append(", "); |
144 LogParam(p.amount(), l); | 154 LogParam(p.amount(), l); |
145 break; | 155 break; |
| 156 default: |
| 157 // FIXME: temporary place holder to prevent build failures |
| 158 // (pending a new FilterType). |
| 159 NOTREACHED(); |
| 160 break; |
146 } | 161 } |
147 l->append(")"); | 162 l->append(")"); |
148 } | 163 } |
149 | 164 |
150 void ParamTraits<WebKit::WebFilterOperations>::Write( | 165 void ParamTraits<WebKit::WebFilterOperations>::Write( |
151 Message* m, const param_type& p) { | 166 Message* m, const param_type& p) { |
152 WriteParam(m, p.size()); | 167 WriteParam(m, p.size()); |
153 for (std::size_t i = 0; i < p.size(); ++i) { | 168 for (std::size_t i = 0; i < p.size(); ++i) { |
154 WriteParam(m, p.at(i)); | 169 WriteParam(m, p.at(i)); |
155 } | 170 } |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 l->append(", ["); | 666 l->append(", ["); |
652 for (size_t i = 0; i < p.render_pass_list.size(); ++i) { | 667 for (size_t i = 0; i < p.render_pass_list.size(); ++i) { |
653 if (i) | 668 if (i) |
654 l->append(", "); | 669 l->append(", "); |
655 LogParam(*p.render_pass_list[i], l); | 670 LogParam(*p.render_pass_list[i], l); |
656 } | 671 } |
657 l->append("])"); | 672 l->append("])"); |
658 } | 673 } |
659 | 674 |
660 } // namespace IPC | 675 } // namespace IPC |
OLD | NEW |