solid_color_layer.h 965 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef CC_LAYERS_SOLID_COLOR_LAYER_H_
  5. #define CC_LAYERS_SOLID_COLOR_LAYER_H_
  6. #include <memory>
  7. #include "cc/cc_export.h"
  8. #include "cc/layers/layer.h"
  9. namespace cc {
  10. // A Layer that renders a solid color. The color is specified by using
  11. // SetBackgroundColor() on the base class.
  12. class CC_EXPORT SolidColorLayer : public Layer {
  13. public:
  14. static scoped_refptr<SolidColorLayer> Create();
  15. SolidColorLayer(const SolidColorLayer&) = delete;
  16. SolidColorLayer& operator=(const SolidColorLayer&) = delete;
  17. std::unique_ptr<LayerImpl> CreateLayerImpl(
  18. LayerTreeImpl* tree_impl) const override;
  19. void SetBackgroundColor(SkColor4f color) override;
  20. protected:
  21. SolidColorLayer();
  22. private:
  23. ~SolidColorLayer() override;
  24. };
  25. } // namespace cc
  26. #endif // CC_LAYERS_SOLID_COLOR_LAYER_H_