OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "services/ui/ws/frame_generator.h" | 5 #include "services/ui/ws/frame_generator.h" |
6 | 6 |
7 #include "base/containers/adapters.h" | 7 #include "base/containers/adapters.h" |
8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
9 #include "cc/quads/render_pass.h" | 9 #include "cc/quads/render_pass.h" |
10 #include "cc/quads/render_pass_draw_quad.h" | 10 #include "cc/quads/render_pass_draw_quad.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 const gfx::Rect bounds_at_origin(window->bounds().size()); | 168 const gfx::Rect bounds_at_origin(window->bounds().size()); |
169 // TODO(fsamuel): These clipping and visible rects are incorrect. They need | 169 // TODO(fsamuel): These clipping and visible rects are incorrect. They need |
170 // to be populated from CompositorFrame structs. | 170 // to be populated from CompositorFrame structs. |
171 sqs->SetAll(quad_to_target_transform, | 171 sqs->SetAll(quad_to_target_transform, |
172 bounds_at_origin.size() /* layer_bounds */, | 172 bounds_at_origin.size() /* layer_bounds */, |
173 bounds_at_origin /* visible_layer_bounds */, | 173 bounds_at_origin /* visible_layer_bounds */, |
174 bounds_at_origin /* clip_rect */, false /* is_clipped */, | 174 bounds_at_origin /* clip_rect */, false /* is_clipped */, |
175 combined_opacity, SkXfermode::kSrcOver_Mode, | 175 combined_opacity, SkXfermode::kSrcOver_Mode, |
176 0 /* sorting-context_id */); | 176 0 /* sorting-context_id */); |
177 auto quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); | 177 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
178 quad->SetAll(sqs, bounds_at_origin /* rect */, | 178 quad->SetAll(sqs, bounds_at_origin /* rect */, |
179 gfx::Rect() /* opaque_rect */, | 179 gfx::Rect() /* opaque_rect */, |
180 bounds_at_origin /* visible_rect */, true /* needs_blending*/, | 180 bounds_at_origin /* visible_rect */, true /* needs_blending*/, |
181 default_surface->id()); | 181 default_surface->id()); |
182 } | 182 } |
183 if (underlay_surface) { | 183 if (underlay_surface) { |
184 const gfx::Rect underlay_absolute_bounds = | 184 const gfx::Rect underlay_absolute_bounds = |
185 absolute_bounds - window->underlay_offset(); | 185 absolute_bounds - window->underlay_offset(); |
186 gfx::Transform quad_to_target_transform; | 186 gfx::Transform quad_to_target_transform; |
187 quad_to_target_transform.Translate(underlay_absolute_bounds.x(), | 187 quad_to_target_transform.Translate(underlay_absolute_bounds.x(), |
188 underlay_absolute_bounds.y()); | 188 underlay_absolute_bounds.y()); |
189 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 189 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
190 const gfx::Rect bounds_at_origin( | 190 const gfx::Rect bounds_at_origin( |
191 underlay_surface->last_submitted_frame_size()); | 191 underlay_surface->last_submitted_frame_size()); |
192 sqs->SetAll(quad_to_target_transform, | 192 sqs->SetAll(quad_to_target_transform, |
193 bounds_at_origin.size() /* layer_bounds */, | 193 bounds_at_origin.size() /* layer_bounds */, |
194 bounds_at_origin /* visible_layer_bounds */, | 194 bounds_at_origin /* visible_layer_bounds */, |
195 bounds_at_origin /* clip_rect */, false /* is_clipped */, | 195 bounds_at_origin /* clip_rect */, false /* is_clipped */, |
196 combined_opacity, SkXfermode::kSrcOver_Mode, | 196 combined_opacity, SkXfermode::kSrcOver_Mode, |
197 0 /* sorting-context_id */); | 197 0 /* sorting-context_id */); |
198 | 198 |
199 auto quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); | 199 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
200 quad->SetAll(sqs, bounds_at_origin /* rect */, | 200 quad->SetAll(sqs, bounds_at_origin /* rect */, |
201 gfx::Rect() /* opaque_rect */, | 201 gfx::Rect() /* opaque_rect */, |
202 bounds_at_origin /* visible_rect */, true /* needs_blending*/, | 202 bounds_at_origin /* visible_rect */, true /* needs_blending*/, |
203 underlay_surface->id()); | 203 underlay_surface->id()); |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
207 } // namespace ws | 207 } // namespace ws |
208 | 208 |
209 } // namespace ui | 209 } // namespace ui |
OLD | NEW |