ca_layer_frame_sink.h 1.1 KB

12345678910111213141516171819202122232425262728293031
  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
  3. // found in the LICENSE file.
  4. #ifndef UI_ACCELERATED_WIDGET_MAC_CA_LAYER_FRAME_SINK_H_
  5. #define UI_ACCELERATED_WIDGET_MAC_CA_LAYER_FRAME_SINK_H_
  6. #include "ui/accelerated_widget_mac/accelerated_widget_mac_export.h"
  7. #include "ui/gfx/ca_layer_params.h"
  8. #include "ui/gfx/native_widget_types.h"
  9. namespace ui {
  10. // An interface to an NSView that will embed content described by CALayerParams
  11. // in its heirarchy.
  12. class ACCELERATED_WIDGET_MAC_EXPORT CALayerFrameSink {
  13. public:
  14. virtual ~CALayerFrameSink() {}
  15. // Translate from a gfx::AcceleratedWidget to the gfx::CALayerFrameSink
  16. // interface through which frames may be submitted. This may return nullptr.
  17. static CALayerFrameSink* FromAcceleratedWidget(gfx::AcceleratedWidget widget);
  18. // Update the embedder's CALayer tree to show the content described by
  19. // |ca_layer_params|.
  20. virtual void UpdateCALayerTree(const gfx::CALayerParams& ca_layer_params) = 0;
  21. };
  22. } // namespace ui
  23. #endif // UI_ACCELERATED_WIDGET_MAC_CA_LAYER_FRAME_SINK_H_