content_layer_client.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_CONTENT_LAYER_CLIENT_H_
  5. #define CC_LAYERS_CONTENT_LAYER_CLIENT_H_
  6. #include <stddef.h>
  7. #include "cc/cc_export.h"
  8. #include "cc/paint/display_item_list.h"
  9. namespace gfx {
  10. class Rect;
  11. }
  12. namespace cc {
  13. class CC_EXPORT ContentLayerClient {
  14. public:
  15. // The paintable region is the rectangular region, within the bounds of the
  16. // layer this client paints, that the client is capable of painting via
  17. // paintContents(). Calling paintContents() will return a DisplayItemList
  18. // that is guaranteed valid only within this region.
  19. virtual gfx::Rect PaintableRegion() const = 0;
  20. // Paints the content area for the layer, typically dirty rects submitted
  21. // to the layer itself, into a DisplayItemList that it returns. The
  22. // PaintingControlSetting enum controls painting to isolate different
  23. // components in performance tests.
  24. virtual scoped_refptr<DisplayItemList> PaintContentsToDisplayList() = 0;
  25. // If true the layer may skip clearing the background before rasterizing,
  26. // because it will cover any uncleared data with content.
  27. virtual bool FillsBoundsCompletely() const = 0;
  28. protected:
  29. virtual ~ContentLayerClient() {}
  30. };
  31. } // namespace cc
  32. #endif // CC_LAYERS_CONTENT_LAYER_CLIENT_H_