Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/mus/ws/platform_display.h" | 5 #include "components/mus/ws/platform_display.h" |
| 6 | 6 |
| 7 #include "base/numerics/safe_conversions.h" | 7 #include "base/numerics/safe_conversions.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 if (draw_default_surface) { | 107 if (draw_default_surface) { |
| 108 gfx::Transform quad_to_target_transform; | 108 gfx::Transform quad_to_target_transform; |
| 109 quad_to_target_transform.Translate(absolute_bounds.x(), | 109 quad_to_target_transform.Translate(absolute_bounds.x(), |
| 110 absolute_bounds.y()); | 110 absolute_bounds.y()); |
| 111 | 111 |
| 112 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 112 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
| 113 | 113 |
| 114 const gfx::Rect bounds_at_origin(window->bounds().size()); | 114 const gfx::Rect bounds_at_origin(window->bounds().size()); |
| 115 // TODO(fsamuel): These clipping and visible rects are incorrect. They need | 115 // TODO(fsamuel): These clipping and visible rects are incorrect. They need |
| 116 // to be populated from CompositorFrame structs. | 116 // to be populated from CompositorFrame structs. |
| 117 sqs->SetAll( | 117 sqs->SetAll(quad_to_target_transform, |
| 118 quad_to_target_transform, bounds_at_origin.size() /* layer_bounds */, | 118 bounds_at_origin.size() /* layer_bounds */, |
| 119 bounds_at_origin /* visible_layer_bounds */, | 119 bounds_at_origin /* visible_layer_bounds */, |
| 120 bounds_at_origin /* clip_rect */, false /* is_clipped */, | 120 bounds_at_origin /* clip_rect */, false /* is_clipped */, |
| 121 window->opacity(), SkXfermode::kSrc_Mode, 0 /* sorting-context_id */); | 121 window->opacity(), SkXfermode::kSrcOver_Mode, |
|
sky
2016/04/25 16:00:15
AHA! This must be the random CHECK I randomly see:
| |
| 122 0 /* sorting-context_id */); | |
| 122 auto quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); | 123 auto quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
| 123 quad->SetAll(sqs, bounds_at_origin /* rect */, | 124 quad->SetAll(sqs, bounds_at_origin /* rect */, |
| 124 gfx::Rect() /* opaque_rect */, | 125 gfx::Rect() /* opaque_rect */, |
| 125 bounds_at_origin /* visible_rect */, true /* needs_blending*/, | 126 bounds_at_origin /* visible_rect */, true /* needs_blending*/, |
| 126 default_surface->id()); | 127 default_surface->id()); |
| 127 } | 128 } |
| 128 if (underlay_surface) { | 129 if (underlay_surface) { |
| 129 const gfx::Rect underlay_absolute_bounds = | 130 const gfx::Rect underlay_absolute_bounds = |
| 130 absolute_bounds - window->underlay_offset(); | 131 absolute_bounds - window->underlay_offset(); |
| 131 gfx::Transform quad_to_target_transform; | 132 gfx::Transform quad_to_target_transform; |
| 132 quad_to_target_transform.Translate(underlay_absolute_bounds.x(), | 133 quad_to_target_transform.Translate(underlay_absolute_bounds.x(), |
| 133 underlay_absolute_bounds.y()); | 134 underlay_absolute_bounds.y()); |
| 134 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 135 cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
| 135 const gfx::Rect bounds_at_origin( | 136 const gfx::Rect bounds_at_origin( |
| 136 underlay_surface->last_submitted_frame_size()); | 137 underlay_surface->last_submitted_frame_size()); |
| 137 sqs->SetAll( | 138 sqs->SetAll( |
| 138 quad_to_target_transform, bounds_at_origin.size() /* layer_bounds */, | 139 quad_to_target_transform, bounds_at_origin.size() /* layer_bounds */, |
| 139 bounds_at_origin /* visible_layer_bounds */, | 140 bounds_at_origin /* visible_layer_bounds */, |
| 140 bounds_at_origin /* clip_rect */, false /* is_clipped */, | 141 bounds_at_origin /* clip_rect */, false /* is_clipped */, |
| 141 window->opacity(), SkXfermode::kSrc_Mode, 0 /* sorting-context_id */); | 142 window->opacity(), SkXfermode::kSrc_Mode, 0 /* sorting-context_id */); |
|
sky
2016/04/25 16:04:17
Should this be updated too?
kylechar
2016/04/25 16:39:53
It seems like this would cause a crash in the same
| |
| 142 | 143 |
| 143 auto quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); | 144 auto quad = pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>(); |
| 144 quad->SetAll(sqs, bounds_at_origin /* rect */, | 145 quad->SetAll(sqs, bounds_at_origin /* rect */, |
| 145 gfx::Rect() /* opaque_rect */, | 146 gfx::Rect() /* opaque_rect */, |
| 146 bounds_at_origin /* visible_rect */, true /* needs_blending*/, | 147 bounds_at_origin /* visible_rect */, true /* needs_blending*/, |
| 147 underlay_surface->id()); | 148 underlay_surface->id()); |
| 148 } | 149 } |
| 149 } | 150 } |
| 150 | 151 |
| 151 } // namespace | 152 } // namespace |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 | 433 |
| 433 void DefaultPlatformDisplay::RequestCopyOfOutput( | 434 void DefaultPlatformDisplay::RequestCopyOfOutput( |
| 434 std::unique_ptr<cc::CopyOutputRequest> output_request) { | 435 std::unique_ptr<cc::CopyOutputRequest> output_request) { |
| 435 if (top_level_display_client_) | 436 if (top_level_display_client_) |
| 436 top_level_display_client_->RequestCopyOfOutput(std::move(output_request)); | 437 top_level_display_client_->RequestCopyOfOutput(std::move(output_request)); |
| 437 } | 438 } |
| 438 | 439 |
| 439 } // namespace ws | 440 } // namespace ws |
| 440 | 441 |
| 441 } // namespace mus | 442 } // namespace mus |
| OLD | NEW |