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/overlay_transform.h"
18 class ContextSupport
{
20 // Runs |callback| when a sync point is reached.
21 virtual void SignalSyncPoint(uint32 sync_point
,
22 const base::Closure
& callback
) = 0;
24 // Runs |callback| when a query created via glCreateQueryEXT() has cleared
25 // passed the glEndQueryEXT() point.
26 virtual void SignalQuery(uint32 query
, const base::Closure
& callback
) = 0;
28 // For onscreen contexts, indicates that the surface visibility has changed.
29 // Clients aren't expected to draw to an invisible surface.
30 virtual void SetSurfaceVisible(bool visible
) = 0;
32 // Indicates whether the context should aggressively free allocated resources.
33 // If set to true, the context will purge all temporary resources when
35 virtual void SetAggressivelyFreeResources(
36 bool aggressively_free_resources
) = 0;
38 virtual void Swap() = 0;
39 virtual void PartialSwapBuffers(const gfx::Rect
& sub_buffer
) = 0;
41 // Schedule a texture to be presented as an overlay synchronously with the
42 // primary surface during the next buffer swap.
43 // This method is not stateful and needs to be re-scheduled every frame.
44 virtual void ScheduleOverlayPlane(int plane_z_order
,
45 gfx::OverlayTransform plane_transform
,
46 unsigned overlay_texture_id
,
47 const gfx::Rect
& display_bounds
,
48 const gfx::RectF
& uv_rect
) = 0;
50 virtual uint32
InsertFutureSyncPointCHROMIUM() = 0;
51 virtual void RetireSyncPointCHROMIUM(uint32 sync_point
) = 0;
53 // Returns an ID that can be used to globally identify the share group that
54 // this context's resources belong to.
55 virtual uint64_t ShareGroupTracingGUID() const = 0;
59 virtual ~ContextSupport() {}
64 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_