| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 sqs->SetAll(quad_to_target_transform, | 196 sqs->SetAll(quad_to_target_transform, |
| 197 bounds_at_origin.size() /* layer_bounds */, | 197 bounds_at_origin.size() /* layer_bounds */, |
| 198 bounds_at_origin /* visible_layer_bounds */, | 198 bounds_at_origin /* visible_layer_bounds */, |
| 199 bounds_at_origin /* clip_rect */, false /* is_clipped */, | 199 bounds_at_origin /* clip_rect */, false /* is_clipped */, |
| 200 combined_opacity, SkXfermode::kSrcOver_Mode, | 200 combined_opacity, SkXfermode::kSrcOver_Mode, |
| 201 0 /* sorting-context_id */); | 201 0 /* sorting-context_id */); |
| 202 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); | 202 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
| 203 quad->SetAll(sqs, bounds_at_origin /* rect */, | 203 quad->SetAll(sqs, bounds_at_origin /* rect */, |
| 204 gfx::Rect() /* opaque_rect */, | 204 gfx::Rect() /* opaque_rect */, |
| 205 bounds_at_origin /* visible_rect */, true /* needs_blending*/, | 205 bounds_at_origin /* visible_rect */, true /* needs_blending*/, |
| 206 default_surface->id()); | 206 default_surface->GetSurfaceId()); |
| 207 if (default_surface->may_contain_video()) | 207 if (default_surface->may_contain_video()) |
| 208 *may_contain_video = true; | 208 *may_contain_video = true; |
| 209 } | 209 } |
| 210 if (underlay_surface) { | 210 if (underlay_surface) { |
| 211 const gfx::Rect underlay_absolute_bounds = | 211 const gfx::Rect underlay_absolute_bounds = |
| 212 absolute_bounds - window->underlay_offset(); | 212 absolute_bounds - window->underlay_offset(); |
| 213 gfx::Transform quad_to_target_transform; | 213 gfx::Transform quad_to_target_transform; |
| 214 quad_to_target_transform.Translate(underlay_absolute_bounds.x(), | 214 quad_to_target_transform.Translate(underlay_absolute_bounds.x(), |
| 215 underlay_absolute_bounds.y()); | 215 underlay_absolute_bounds.y()); |
| 216 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 216 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
| 217 const gfx::Rect bounds_at_origin( | 217 const gfx::Rect bounds_at_origin( |
| 218 underlay_surface->last_submitted_frame_size()); | 218 underlay_surface->last_submitted_frame_size()); |
| 219 sqs->SetAll(quad_to_target_transform, | 219 sqs->SetAll(quad_to_target_transform, |
| 220 bounds_at_origin.size() /* layer_bounds */, | 220 bounds_at_origin.size() /* layer_bounds */, |
| 221 bounds_at_origin /* visible_layer_bounds */, | 221 bounds_at_origin /* visible_layer_bounds */, |
| 222 bounds_at_origin /* clip_rect */, false /* is_clipped */, | 222 bounds_at_origin /* clip_rect */, false /* is_clipped */, |
| 223 combined_opacity, SkXfermode::kSrcOver_Mode, | 223 combined_opacity, SkXfermode::kSrcOver_Mode, |
| 224 0 /* sorting-context_id */); | 224 0 /* sorting-context_id */); |
| 225 | 225 |
| 226 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); | 226 auto* quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
| 227 quad->SetAll(sqs, bounds_at_origin /* rect */, | 227 quad->SetAll(sqs, bounds_at_origin /* rect */, |
| 228 gfx::Rect() /* opaque_rect */, | 228 gfx::Rect() /* opaque_rect */, |
| 229 bounds_at_origin /* visible_rect */, true /* needs_blending*/, | 229 bounds_at_origin /* visible_rect */, true /* needs_blending*/, |
| 230 underlay_surface->id()); | 230 underlay_surface->GetSurfaceId()); |
| 231 DCHECK(!underlay_surface->may_contain_video()); | 231 DCHECK(!underlay_surface->may_contain_video()); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace ws | 235 } // namespace ws |
| 236 | 236 |
| 237 } // namespace ui | 237 } // namespace ui |
| OLD | NEW |