forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdirect_output_surface.h
47 lines (36 loc) · 1.57 KB
/
direct_output_surface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2014 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 SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_H_
#define SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_H_
#include <memory>
#include "cc/output/output_surface.h"
#include "services/ui/surfaces/surfaces_context_provider.h"
#include "services/ui/surfaces/surfaces_context_provider_delegate.h"
namespace cc {
class CompositorFrame;
class SyntheticBeginFrameSource;
}
namespace ui {
// An OutputSurface implementation that directly draws and
// swaps to an actual GL surface.
class DirectOutputSurface : public cc::OutputSurface,
public SurfacesContextProviderDelegate {
public:
explicit DirectOutputSurface(
scoped_refptr<SurfacesContextProvider> context_provider,
cc::SyntheticBeginFrameSource* synthetic_begin_frame_source);
~DirectOutputSurface() override;
// cc::OutputSurface implementation
bool BindToClient(cc::OutputSurfaceClient* client) override;
void SwapBuffers(cc::CompositorFrame frame) override;
uint32_t GetFramebufferCopyTextureFormat() override;
// SurfacesContextProviderDelegate implementation
void OnVSyncParametersUpdated(const base::TimeTicks& timebase,
const base::TimeDelta& interval) override;
private:
cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_;
base::WeakPtrFactory<DirectOutputSurface> weak_ptr_factory_;
};
} // namespace ui
#endif // SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_H_