skia_bitmap_desktop_frame.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2014 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 REMOTING_HOST_CHROMEOS_SKIA_BITMAP_DESKTOP_FRAME_H_
  5. #define REMOTING_HOST_CHROMEOS_SKIA_BITMAP_DESKTOP_FRAME_H_
  6. #include <stdint.h>
  7. #include <memory>
  8. #include "third_party/skia/include/core/SkBitmap.h"
  9. #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
  10. namespace remoting {
  11. // DesktopFrame implementation used by screen capture on ChromeOS.
  12. // Frame data is stored in a SkBitmap.
  13. class SkiaBitmapDesktopFrame : public webrtc::DesktopFrame {
  14. public:
  15. static SkiaBitmapDesktopFrame* Create(std::unique_ptr<SkBitmap> bitmap);
  16. SkiaBitmapDesktopFrame(const SkiaBitmapDesktopFrame&) = delete;
  17. SkiaBitmapDesktopFrame& operator=(const SkiaBitmapDesktopFrame&) = delete;
  18. ~SkiaBitmapDesktopFrame() override;
  19. private:
  20. SkiaBitmapDesktopFrame(webrtc::DesktopSize size,
  21. int stride,
  22. uint8_t* data,
  23. std::unique_ptr<SkBitmap> bitmap);
  24. std::unique_ptr<SkBitmap> bitmap_;
  25. };
  26. } // namespace remoting
  27. #endif // REMOTING_HOST_CHROMEOS_SKIA_BITMAP_DESKTOP_FRAME_H_