delegated_ink_point_renderer_skia_for_test.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2021 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 COMPONENTS_VIZ_TEST_DELEGATED_INK_POINT_RENDERER_SKIA_FOR_TEST_H_
  5. #define COMPONENTS_VIZ_TEST_DELEGATED_INK_POINT_RENDERER_SKIA_FOR_TEST_H_
  6. #include <memory>
  7. #include "components/viz/service/display/delegated_ink_point_renderer_skia.h"
  8. namespace viz {
  9. // Test class that just holds on to the most recently received metadata,
  10. // specifically for testing purposes.
  11. class DelegatedInkPointRendererSkiaForTest
  12. : public DelegatedInkPointRendererSkia {
  13. public:
  14. DelegatedInkPointRendererSkiaForTest();
  15. ~DelegatedInkPointRendererSkiaForTest() override;
  16. void SetDelegatedInkMetadata(
  17. std::unique_ptr<gfx::DelegatedInkMetadata> metadata) override;
  18. const gfx::DelegatedInkMetadata* last_metadata() const {
  19. return last_metadata_.get();
  20. }
  21. private:
  22. std::unique_ptr<gfx::DelegatedInkMetadata> last_metadata_;
  23. };
  24. } // namespace viz
  25. #endif // COMPONENTS_VIZ_TEST_DELEGATED_INK_POINT_RENDERER_SKIA_FOR_TEST_H_