OLD | NEW |
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 #include "components/exo/surface.h" | 5 #include "components/exo/surface.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 1.f / scaled_buffer_size.height()); | 699 1.f / scaled_buffer_size.height()); |
700 } | 700 } |
701 | 701 |
702 // pending_damage_ is in Surface coordinates. | 702 // pending_damage_ is in Surface coordinates. |
703 gfx::Rect damage_rect = full_damage | 703 gfx::Rect damage_rect = full_damage |
704 ? gfx::Rect(contents_surface_size) | 704 ? gfx::Rect(contents_surface_size) |
705 : gfx::SkIRectToRect(pending_damage_.getBounds()); | 705 : gfx::SkIRectToRect(pending_damage_.getBounds()); |
706 | 706 |
707 const int kRenderPassId = 1; | 707 const int kRenderPassId = 1; |
708 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); | 708 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); |
709 render_pass->SetAll(kRenderPassId, gfx::Rect(contents_surface_size), | 709 render_pass->SetNew(kRenderPassId, gfx::Rect(contents_surface_size), |
710 damage_rect, gfx::Transform(), true); | 710 damage_rect, gfx::Transform()); |
711 | 711 |
712 gfx::Rect quad_rect = gfx::Rect(contents_surface_size); | 712 gfx::Rect quad_rect = gfx::Rect(contents_surface_size); |
713 cc::SharedQuadState* quad_state = | 713 cc::SharedQuadState* quad_state = |
714 render_pass->CreateAndAppendSharedQuadState(); | 714 render_pass->CreateAndAppendSharedQuadState(); |
715 quad_state->quad_layer_bounds = contents_surface_size; | 715 quad_state->quad_layer_bounds = contents_surface_size; |
716 quad_state->visible_quad_layer_rect = quad_rect; | 716 quad_state->visible_quad_layer_rect = quad_rect; |
717 quad_state->opacity = state_.alpha; | 717 quad_state->opacity = state_.alpha; |
718 | 718 |
719 cc::CompositorFrame frame; | 719 cc::CompositorFrame frame; |
720 if (current_resource_.id) { | 720 if (current_resource_.id) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 | 770 |
771 int64_t Surface::GetPropertyInternal(const void* key, | 771 int64_t Surface::GetPropertyInternal(const void* key, |
772 int64_t default_value) const { | 772 int64_t default_value) const { |
773 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); | 773 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); |
774 if (iter == prop_map_.end()) | 774 if (iter == prop_map_.end()) |
775 return default_value; | 775 return default_value; |
776 return iter->second.value; | 776 return iter->second.value; |
777 } | 777 } |
778 | 778 |
779 } // namespace exo | 779 } // namespace exo |
OLD | NEW |