solid_color_layer.cc 815 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "cc/layers/solid_color_layer.h"
  5. #include <memory>
  6. #include "cc/layers/solid_color_layer_impl.h"
  7. namespace cc {
  8. std::unique_ptr<LayerImpl> SolidColorLayer::CreateLayerImpl(
  9. LayerTreeImpl* tree_impl) const {
  10. return SolidColorLayerImpl::Create(tree_impl, id());
  11. }
  12. scoped_refptr<SolidColorLayer> SolidColorLayer::Create() {
  13. return base::WrapRefCounted(new SolidColorLayer());
  14. }
  15. SolidColorLayer::SolidColorLayer() = default;
  16. SolidColorLayer::~SolidColorLayer() = default;
  17. void SolidColorLayer::SetBackgroundColor(SkColor4f color) {
  18. SetContentsOpaque(color.isOpaque());
  19. Layer::SetBackgroundColor(color);
  20. }
  21. } // namespace cc