Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / cc / test / test_context_support.h
blobf638a0f9f5b6b946fafbe46e61ca26d378a59b9b
1 // Copyright 2013 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.
5 #ifndef CC_TEST_TEST_CONTEXT_SUPPORT_H_
6 #define CC_TEST_TEST_CONTEXT_SUPPORT_H_
8 #include <vector>
10 #include "base/memory/weak_ptr.h"
11 #include "gpu/command_buffer/client/context_support.h"
13 namespace gfx {
14 class Rect;
15 class RectF;
18 namespace cc {
20 class TestContextSupport : public gpu::ContextSupport {
21 public:
22 TestContextSupport();
23 ~TestContextSupport() override;
25 // gpu::ContextSupport implementation.
26 void SignalSyncPoint(uint32 sync_point,
27 const base::Closure& callback) override;
28 void SignalQuery(uint32 query, const base::Closure& callback) override;
29 void SetSurfaceVisible(bool visible) override;
30 void SetAggressivelyFreeResources(bool aggressively_free_resources) override;
31 void Swap() override;
32 void PartialSwapBuffers(const gfx::Rect& sub_buffer) override;
33 uint32 InsertFutureSyncPointCHROMIUM() override;
34 void RetireSyncPointCHROMIUM(uint32 sync_point) override;
35 void ScheduleOverlayPlane(int plane_z_order,
36 gfx::OverlayTransform plane_transform,
37 unsigned overlay_texture_id,
38 const gfx::Rect& display_bounds,
39 const gfx::RectF& uv_rect) override;
41 void CallAllSyncPointCallbacks();
43 typedef base::Callback<void(bool visible)> SurfaceVisibleCallback;
44 void SetSurfaceVisibleCallback(
45 const SurfaceVisibleCallback& set_visible_callback);
47 typedef base::Callback<void(int plane_z_order,
48 gfx::OverlayTransform plane_transform,
49 unsigned overlay_texture_id,
50 const gfx::Rect& display_bounds,
51 const gfx::RectF& crop_rect)>
52 ScheduleOverlayPlaneCallback;
53 void SetScheduleOverlayPlaneCallback(
54 const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback);
56 private:
57 std::vector<base::Closure> sync_point_callbacks_;
58 SurfaceVisibleCallback set_visible_callback_;
59 ScheduleOverlayPlaneCallback schedule_overlay_plane_callback_;
61 base::WeakPtrFactory<TestContextSupport> weak_ptr_factory_;
63 DISALLOW_COPY_AND_ASSIGN(TestContextSupport);
66 } // namespace cc
68 #endif // CC_TEST_TEST_CONTEXT_SUPPORT_H_