forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchild_frame_compositing_helper.h
66 lines (49 loc) · 1.78 KB
/
child_frame_compositing_helper.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// 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 CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_
#define CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "base/macros.h"
#include "cc/layers/surface_layer.h"
#include "components/viz/common/surfaces/surface_id.h"
#include "content/common/content_export.h"
namespace gfx {
class Size;
}
namespace viz {
class SurfaceId;
}
namespace content {
class ChildFrameCompositor;
class CONTENT_EXPORT ChildFrameCompositingHelper {
public:
explicit ChildFrameCompositingHelper(
ChildFrameCompositor* child_frame_compositor);
virtual ~ChildFrameCompositingHelper();
void SetPrimarySurfaceId(const viz::SurfaceId& surface_id,
const gfx::Size& frame_size_in_dip,
const cc::DeadlinePolicy& deadline);
void SetFallbackSurfaceId(const viz::SurfaceId& surface_id,
const gfx::Size& frame_size_in_dip);
void UpdateVisibility(bool visible);
void ChildFrameGone(const gfx::Size& frame_size_in_dip,
float device_scale_factor);
const viz::SurfaceId& primary_surface_id() const {
return primary_surface_id_;
}
const viz::SurfaceId& fallback_surface_id() const {
return fallback_surface_id_;
}
private:
ChildFrameCompositor* const child_frame_compositor_;
viz::SurfaceId primary_surface_id_;
viz::SurfaceId fallback_surface_id_;
scoped_refptr<cc::SurfaceLayer> surface_layer_;
DISALLOW_COPY_AND_ASSIGN(ChildFrameCompositingHelper);
};
} // namespace content
#endif // CONTENT_RENDERER_CHILD_FRAME_COMPOSITING_HELPER_H_