blob: abbb20c065d5e53d5172d0c731a3a325f2ce58ca (
plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
// Copyright 2015 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 CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
#define CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
#include <stdint.h>
#include "base/cancelable_callback.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "content/browser/compositor/browser_compositor_output_surface.h"
namespace ui {
class CompositorVSyncManager;
}
namespace content {
class CommandBufferProxyImpl;
class ReflectorTexture;
class OffscreenBrowserCompositorOutputSurface
: public BrowserCompositorOutputSurface {
public:
OffscreenBrowserCompositorOutputSurface(
const scoped_refptr<ContextProviderCommandBuffer>& context,
const scoped_refptr<ContextProviderCommandBuffer>& worker_context,
const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
scoped_ptr<BrowserCompositorOverlayCandidateValidator>
overlay_candidate_validator);
~OffscreenBrowserCompositorOutputSurface() override;
protected:
// cc::OutputSurface:
void EnsureBackbuffer() override;
void DiscardBackbuffer() override;
void Reshape(const gfx::Size& size, float scale_factor, bool alpha) override;
void BindFramebuffer() override;
void SwapBuffers(cc::CompositorFrame* frame) override;
// BrowserCompositorOutputSurface
void OnReflectorChanged() override;
base::Closure CreateCompositionStartedCallback() override;
void OnGpuSwapBuffersCompleted(
const std::vector<ui::LatencyInfo>& latency_info,
gfx::SwapResult result) override{};
#if defined(OS_MACOSX)
void SetSurfaceSuspendedForRecycle(bool suspended) override {};
bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override;
#endif
uint32_t fbo_;
bool is_backbuffer_discarded_;
scoped_ptr<ReflectorTexture> reflector_texture_;
base::WeakPtrFactory<OffscreenBrowserCompositorOutputSurface>
weak_ptr_factory_;
private:
DISALLOW_COPY_AND_ASSIGN(OffscreenBrowserCompositorOutputSurface);
};
} // namespace content
#endif // CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
|