| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/output/filter_operations.h" | 5 #include "cc/output/filter_operations.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <numeric> | 10 #include <numeric> |
| 11 | 11 |
| 12 #include "base/trace_event/trace_event_argument.h" | 12 #include "base/trace_event/trace_event_argument.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "cc/output/filter_operation.h" | 14 #include "cc/output/filter_operation.h" |
| 15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 FilterOperations::FilterOperations() {} | 19 FilterOperations::FilterOperations() {} |
| 20 | 20 |
| 21 FilterOperations::FilterOperations(const FilterOperations& other) | 21 FilterOperations::FilterOperations(const FilterOperations& other) |
| 22 : operations_(other.operations_) {} | 22 : operations_(other.operations_) {} |
| 23 | 23 |
| 24 FilterOperations::FilterOperations(std::vector<FilterOperation>&& operations) |
| 25 : operations_(std::move(operations)) {} |
| 26 |
| 24 FilterOperations::~FilterOperations() {} | 27 FilterOperations::~FilterOperations() {} |
| 25 | 28 |
| 26 FilterOperations& FilterOperations::operator=(const FilterOperations& other) { | 29 FilterOperations& FilterOperations::operator=(const FilterOperations& other) { |
| 27 operations_ = other.operations_; | 30 operations_ = other.operations_; |
| 28 return *this; | 31 return *this; |
| 29 } | 32 } |
| 30 | 33 |
| 34 FilterOperations& FilterOperations::operator=(FilterOperations&& other) { |
| 35 operations_ = std::move(other.operations_); |
| 36 return *this; |
| 37 } |
| 38 |
| 31 bool FilterOperations::operator==(const FilterOperations& other) const { | 39 bool FilterOperations::operator==(const FilterOperations& other) const { |
| 32 if (other.size() != size()) | 40 if (other.size() != size()) |
| 33 return false; | 41 return false; |
| 34 for (size_t i = 0; i < size(); ++i) { | 42 for (size_t i = 0; i < size(); ++i) { |
| 35 if (other.at(i) != at(i)) | 43 if (other.at(i) != at(i)) |
| 36 return false; | 44 return false; |
| 37 } | 45 } |
| 38 return true; | 46 return true; |
| 39 } | 47 } |
| 40 | 48 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 void FilterOperations::AsValueInto( | 229 void FilterOperations::AsValueInto( |
| 222 base::trace_event::TracedValue* value) const { | 230 base::trace_event::TracedValue* value) const { |
| 223 for (size_t i = 0; i < operations_.size(); ++i) { | 231 for (size_t i = 0; i < operations_.size(); ++i) { |
| 224 value->BeginDictionary(); | 232 value->BeginDictionary(); |
| 225 operations_[i].AsValueInto(value); | 233 operations_[i].AsValueInto(value); |
| 226 value->EndDictionary(); | 234 value->EndDictionary(); |
| 227 } | 235 } |
| 228 } | 236 } |
| 229 | 237 |
| 230 } // namespace cc | 238 } // namespace cc |
| OLD | NEW |