| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "core/paint/RarePaintData.h" | 5 #include "core/paint/RarePaintData.h" |
| 6 | 6 |
| 7 #include "core/paint/ObjectPaintProperties.h" | 7 #include "core/paint/FragmentData.h" |
| 8 #include "core/paint/PaintLayer.h" | 8 #include "core/paint/PaintLayer.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 RarePaintData::RarePaintData() {} | 12 RarePaintData::RarePaintData() {} |
| 13 | 13 |
| 14 RarePaintData::~RarePaintData() {} | 14 RarePaintData::~RarePaintData() {} |
| 15 | 15 |
| 16 void RarePaintData::SetLayer(std::unique_ptr<PaintLayer> layer) { | 16 void RarePaintData::SetLayer(std::unique_ptr<PaintLayer> layer) { |
| 17 layer_ = std::move(layer); | 17 layer_ = std::move(layer); |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 ObjectPaintProperties& RarePaintData::EnsurePaintProperties() { | 20 FragmentData& RarePaintData::EnsureFragment() const { |
| 21 if (!paint_properties_) | 21 if (!fragment_data_) |
| 22 paint_properties_ = ObjectPaintProperties::Create(); | 22 fragment_data_ = FragmentData::Create(); |
| 23 return *paint_properties_.get(); | 23 return *fragment_data_.get(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 void RarePaintData::ClearPaintProperties() { | 26 void RarePaintData::ClearPaintProperties() { |
| 27 paint_properties_.reset(nullptr); | 27 paint_properties_.reset(nullptr); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void RarePaintData::ClearLocalBorderBoxProperties() { | 30 void RarePaintData::ClearLocalBorderBoxProperties() { |
| 31 local_border_box_properties_ = nullptr; | 31 local_border_box_properties_ = nullptr; |
| 32 } | 32 } |
| 33 | 33 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 49 else if (paint_properties_->CssClip()) | 49 else if (paint_properties_->CssClip()) |
| 50 contents.SetClip(paint_properties_->CssClip()); | 50 contents.SetClip(paint_properties_->CssClip()); |
| 51 } | 51 } |
| 52 | 52 |
| 53 // TODO(chrishtr): cssClipFixedPosition needs to be handled somehow. | 53 // TODO(chrishtr): cssClipFixedPosition needs to be handled somehow. |
| 54 | 54 |
| 55 return contents; | 55 return contents; |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace blink | 58 } // namespace blink |
| OLD | NEW |