We started redesigning GpuMemoryBuffer interface to handle multiple buffers [0].
[chromium-blink-merge.git] / gpu / command_buffer / client / context_support.h
blob6c5b23f0d1e2a322f24ea96b267df18770eb91e0
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 GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_
8 #include "base/callback.h"
9 #include "ui/gfx/geometry/rect.h"
10 #include "ui/gfx/overlay_transform.h"
12 namespace gpu {
14 class ContextSupport {
15 public:
16 // Runs |callback| when a sync point is reached.
17 virtual void SignalSyncPoint(uint32 sync_point,
18 const base::Closure& callback) = 0;
20 // Runs |callback| when a query created via glCreateQueryEXT() has cleared
21 // passed the glEndQueryEXT() point.
22 virtual void SignalQuery(uint32 query, const base::Closure& callback) = 0;
24 // For onscreen contexts, indicates that the surface visibility has changed.
25 // Clients aren't expected to draw to an invisible surface.
26 virtual void SetSurfaceVisible(bool visible) = 0;
28 virtual void Swap() = 0;
29 virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) = 0;
31 // Schedule a texture to be presented as an overlay synchronously with the
32 // primary surface during the next buffer swap.
33 // This method is not stateful and needs to be re-scheduled every frame.
34 virtual void ScheduleOverlayPlane(int plane_z_order,
35 gfx::OverlayTransform plane_transform,
36 unsigned overlay_texture_id,
37 const gfx::Rect& display_bounds,
38 const gfx::RectF& uv_rect) = 0;
40 virtual uint32 InsertFutureSyncPointCHROMIUM() = 0;
41 virtual void RetireSyncPointCHROMIUM(uint32 sync_point) = 0;
43 protected:
44 ContextSupport() {}
45 virtual ~ContextSupport() {}
50 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_