Chromium Code Reviews| Index: blimp/client/test/compositor/test_display_compositor.h |
| diff --git a/blimp/client/test/compositor/test_display_compositor.h b/blimp/client/test/compositor/test_display_compositor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5235c1ab86adb26208ea657a2bbb50074ec23e01 |
| --- /dev/null |
| +++ b/blimp/client/test/compositor/test_display_compositor.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BLIMP_CLIENT_TEST_COMPOSITOR_TEST_DISPLAY_COMPOSITOR_H_ |
| +#define BLIMP_CLIENT_TEST_COMPOSITOR_TEST_DISPLAY_COMPOSITOR_H_ |
| + |
| +#include "base/callback.h" |
| +#include "base/macros.h" |
| +#include "blimp/client/support/compositor/display_compositor.h" |
| + |
| +class SkBitmap; |
| + |
| +namespace cc { |
| +class CopyOutputResult; |
| +} // namespace cc |
| + |
| +namespace blimp { |
| +namespace client { |
| +class CompositorDependencies; |
| + |
| +// An implementation of the DisplayCompositor that supplies a ContextProvider |
| +// that is not backed by a platform specific widget. It is not meant to be used |
| +// to actually display content. It also provides a hook to get access to an |
| +// SkBitmap that represents the cc::Layer passed into |SetContentLayer|. |
| +class TestDisplayCompositor : public DisplayCompositor { |
| + public: |
| + struct CopyRequest { |
| + CopyRequest(); |
| + ~CopyRequest(); |
| + |
| + base::WaitableEvent waiter; |
| + std::unique_ptr<SkBitmap> result; |
| + }; |
| + |
| + explicit TestDisplayCompositor( |
| + CompositorDependencies* compositor_dependencies); |
| + ~TestDisplayCompositor() override; |
| + |
| + // Returns an SkBitmap that represents the cc::Layer hierarchy being drawn by |
| + // this compositor. This will block until the readback completes. |
| + void GetBitmap(CopyRequest* request); |
|
Khushal
2016/09/13 04:47:24
I know you really wanted a sync call but I would s
David Trainor- moved to gerrit
2016/09/13 06:18:05
This is all gone. Moved to BlimpContentsView like
|
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(TestDisplayCompositor); |
| +}; |
| + |
| +} // namespace client |
| +} // namespace blimp |
| + |
| +#endif // BLIMP_CLIENT_TEST_COMPOSITOR_TEST_DISPLAY_COMPOSITOR_H_ |