summaryrefslogtreecommitdiffstats
path: root/cc/output/ca_layer_overlay.h
blob: ab234f4549a657ceeaec4c40a4e69c2932402692 (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
// 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 CC_OUTPUT_CA_LAYER_OVERLAY_H_
#define CC_OUTPUT_CA_LAYER_OVERLAY_H_

#include "cc/quads/render_pass.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
#include "ui/gfx/geometry/rect_f.h"

namespace cc {

class DrawQuad;
class ResourceProvider;

class CC_EXPORT CALayerOverlay {
 public:
  CALayerOverlay();
  ~CALayerOverlay();

  // Texture that corresponds to an IOSurface to set as the content of the
  // CALayer. If this is 0 then the CALayer is a solid color.
  unsigned contents_resource_id = 0;
  // The contents rect property for the CALayer.
  gfx::RectF contents_rect;
  // The opacity property for the CAayer.
  float opacity = 1;
  // The background color property for the CALayer.
  SkColor background_color = SK_ColorTRANSPARENT;
  // The edge anti-aliasing mask property for the CALayer.
  unsigned edge_aa_mask = 0;
  // The bounds for the CALayer in pixels.
  gfx::SizeF bounds_size;
  // The transform to apply to the CALayer.
  SkMatrix44 transform = SkMatrix44(SkMatrix44::kIdentity_Constructor);
};

typedef std::vector<CALayerOverlay> CALayerOverlayList;

// Returns true if all quads in the root render pass have been replaced by
// CALayerOverlays.
bool ProcessForCALayerOverlays(ResourceProvider* resource_provider,
                               const gfx::RectF& display_rect,
                               const QuadList& quad_list,
                               CALayerOverlayList* ca_layer_overlays);

}  // namespace cc

#endif  // CC_OUTPUT_CA_LAYER_OVERLAY_H_