Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: cc/output/ca_layer_overlay.h

Issue 2205133003: Implement new RPDQ copy logic for CALayer promotion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp60_more_refactor
Patch Set: Fix vertical flip. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/output/ca_layer_overlay.cc » ('j') | cc/output/ca_layer_overlay.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_OUTPUT_CA_LAYER_OVERLAY_H_ 5 #ifndef CC_OUTPUT_CA_LAYER_OVERLAY_H_
6 #define CC_OUTPUT_CA_LAYER_OVERLAY_H_ 6 #define CC_OUTPUT_CA_LAYER_OVERLAY_H_
7 7
8 #include "base/memory/linked_ptr.h"
8 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
9 #include "cc/quads/render_pass.h" 10 #include "cc/quads/render_pass.h"
11 #include "cc/quads/render_pass_draw_quad.h"
10 #include "third_party/skia/include/core/SkColor.h" 12 #include "third_party/skia/include/core/SkColor.h"
11 #include "third_party/skia/include/core/SkMatrix44.h" 13 #include "third_party/skia/include/core/SkMatrix44.h"
12 #include "ui/gfx/geometry/rect_f.h" 14 #include "ui/gfx/geometry/rect_f.h"
13 #include "ui/gl/ca_renderer_layer_params.h" 15 #include "ui/gl/ca_renderer_layer_params.h"
14 16
15 namespace cc { 17 namespace cc {
16 18
17 class DrawQuad; 19 class DrawQuad;
18 class ResourceProvider; 20 class ResourceProvider;
19 21
20 // Holds information that is frequently shared between consecutive 22 // Holds information that is frequently shared between consecutive
21 // CALayerOverlays. 23 // CALayerOverlays.
22 class CC_EXPORT CALayerOverlaySharedState 24 class CC_EXPORT CALayerOverlaySharedState
23 : public base::RefCounted<CALayerOverlaySharedState> { 25 : public base::RefCounted<CALayerOverlaySharedState> {
24 public: 26 public:
25 CALayerOverlaySharedState() {} 27 CALayerOverlaySharedState() {}
26 28 CALayerOverlaySharedState& operator=(const CALayerOverlaySharedState& other);
27 // Layers in a non-zero sorting context exist in the same 3D space and should 29 // Layers in a non-zero sorting context exist in the same 3D space and should
28 // intersect. 30 // intersect.
29 unsigned sorting_context_id = 0; 31 unsigned sorting_context_id = 0;
30 // If |is_clipped| is true, then clip to |clip_rect| in the target space. 32 // If |is_clipped| is true, then clip to |clip_rect| in the target space.
31 bool is_clipped = false; 33 bool is_clipped = false;
32 gfx::RectF clip_rect; 34 gfx::RectF clip_rect;
33 // The opacity property for the CAayer. 35 // The opacity property for the CAayer.
34 float opacity = 1; 36 float opacity = 1;
35 // The transform to apply to the CALayer. 37 // The transform to apply to the CALayer.
36 SkMatrix44 transform = SkMatrix44(SkMatrix44::kIdentity_Constructor); 38 SkMatrix44 transform = SkMatrix44(SkMatrix44::kIdentity_Constructor);
(...skipping 22 matching lines...) Expand all
59 gfx::RectF bounds_rect; 61 gfx::RectF bounds_rect;
60 // The background color property for the CALayer. 62 // The background color property for the CALayer.
61 SkColor background_color = SK_ColorTRANSPARENT; 63 SkColor background_color = SK_ColorTRANSPARENT;
62 // The edge anti-aliasing mask property for the CALayer. 64 // The edge anti-aliasing mask property for the CALayer.
63 unsigned edge_aa_mask = 0; 65 unsigned edge_aa_mask = 0;
64 // The minification and magnification filters for the CALayer. 66 // The minification and magnification filters for the CALayer.
65 unsigned filter; 67 unsigned filter;
66 68
67 // If valid, the renderer must copy the contents of the render pass into an 69 // If valid, the renderer must copy the contents of the render pass into an
68 // overlay resource to use as the contents. 70 // overlay resource to use as the contents.
71 // If |rpdq| is present, then the renderer must use the new copy path.
72 // GLRenderer draws filter effects and copies the result into an IOSurface.
73 linked_ptr<RenderPassDrawQuad> rpdq;
ccameron 2016/08/04 01:46:01 unique_ptr, or raw pointer. I'd prefer a raw ptr i
erikchen 2016/08/05 17:15:06 Done.
74
75 // If |render_pass_id| and |filter_effects| are present, then the renderer
76 // must use the old copy path. The filters are serialized and passed to the CA
77 // compositor, which uses CA to draw the filter effects.
69 RenderPassId render_pass_id; 78 RenderPassId render_pass_id;
70 ui::CARendererLayerParams::FilterEffects filter_effects; 79 ui::CARendererLayerParams::FilterEffects filter_effects;
71 }; 80 };
72 81
73 typedef std::vector<CALayerOverlay> CALayerOverlayList; 82 typedef std::vector<CALayerOverlay> CALayerOverlayList;
74 83
75 // Returns true if all quads in the root render pass have been replaced by 84 // Returns true if all quads in the root render pass have been replaced by
76 // CALayerOverlays. 85 // CALayerOverlays.
77 bool ProcessForCALayerOverlays(ResourceProvider* resource_provider, 86 bool ProcessForCALayerOverlays(ResourceProvider* resource_provider,
78 const gfx::RectF& display_rect, 87 const gfx::RectF& display_rect,
79 const QuadList& quad_list, 88 const QuadList& quad_list,
80 CALayerOverlayList* ca_layer_overlays); 89 CALayerOverlayList* ca_layer_overlays);
81 90
82 // Allows RenderPassDrawQuads to be converted to CALayerOverlays. 91 // Allows RenderPassDrawQuads to be converted to CALayerOverlays.
83 void CC_EXPORT EnableRenderPassDrawQuadForTesting(); 92 void CC_EXPORT EnableRenderPassDrawQuadForTesting();
84 93
85 } // namespace cc 94 } // namespace cc
86 95
87 #endif // CC_OUTPUT_CA_LAYER_OVERLAY_H_ 96 #endif // CC_OUTPUT_CA_LAYER_OVERLAY_H_
OLDNEW
« no previous file with comments | « no previous file | cc/output/ca_layer_overlay.cc » ('j') | cc/output/ca_layer_overlay.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698