solid_color_layer_impl.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_IMPL_H_
  5. #define CC_LAYERS_SOLID_COLOR_LAYER_IMPL_H_
  6. #include <memory>
  7. #include "base/memory/ptr_util.h"
  8. #include "cc/cc_export.h"
  9. #include "cc/layers/layer_impl.h"
  10. namespace cc {
  11. class CC_EXPORT SolidColorLayerImpl : public LayerImpl {
  12. public:
  13. static std::unique_ptr<SolidColorLayerImpl> Create(LayerTreeImpl* tree_impl,
  14. int id) {
  15. return base::WrapUnique(new SolidColorLayerImpl(tree_impl, id));
  16. }
  17. SolidColorLayerImpl(const SolidColorLayerImpl&) = delete;
  18. SolidColorLayerImpl& operator=(const SolidColorLayerImpl&) = delete;
  19. static void AppendSolidQuads(viz::CompositorRenderPass* render_pass,
  20. const Occlusion& occlusion_in_layer_space,
  21. viz::SharedQuadState* shared_quad_state,
  22. const gfx::Rect& visible_layer_rect,
  23. SkColor4f color,
  24. bool force_anti_aliasing_off,
  25. SkBlendMode effect_blend_mode,
  26. AppendQuadsData* append_quads_data);
  27. ~SolidColorLayerImpl() override;
  28. // LayerImpl overrides.
  29. std::unique_ptr<LayerImpl> CreateLayerImpl(
  30. LayerTreeImpl* tree_impl) const override;
  31. void AppendQuads(viz::CompositorRenderPass* render_pass,
  32. AppendQuadsData* append_quads_data) override;
  33. protected:
  34. SolidColorLayerImpl(LayerTreeImpl* tree_impl, int id);
  35. private:
  36. const char* LayerTypeAsString() const override;
  37. };
  38. } // namespace cc
  39. #endif // CC_LAYERS_SOLID_COLOR_LAYER_IMPL_H_