snapshot_aura.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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_SNAPSHOT_SNAPSHOT_AURA_H_
  5. #define UI_SNAPSHOT_SNAPSHOT_AURA_H_
  6. #include "ui/snapshot/snapshot.h"
  7. namespace ui {
  8. class Layer;
  9. // These functions are identical to those in snapshot.h, except they're
  10. // guaranteed to read the frame using an Aura CopyOutputRequest and not the
  11. // native windowing system. source_rect and target_size are in DIP.
  12. SNAPSHOT_EXPORT void GrabWindowSnapshotAndScaleAsyncAura(
  13. aura::Window* window,
  14. const gfx::Rect& source_rect,
  15. const gfx::Size& target_size,
  16. GrabWindowSnapshotAsyncCallback callback);
  17. SNAPSHOT_EXPORT void GrabWindowSnapshotAsyncAura(
  18. aura::Window* window,
  19. const gfx::Rect& source_rect,
  20. GrabWindowSnapshotAsyncCallback callback);
  21. // Grabs a snapshot of a |layer| and all its descendants.
  22. // |source_rect| is the bounds of the snapshot content relative to |layer|.
  23. SNAPSHOT_EXPORT void GrabLayerSnapshotAsync(
  24. Layer* layer,
  25. const gfx::Rect& source_rect,
  26. GrabWindowSnapshotAsyncCallback callback);
  27. } // namespace ui
  28. #endif // UI_SNAPSHOT_SNAPSHOT_AURA_H_