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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 1.f / scaled_buffer_size.height()); | 796 1.f / scaled_buffer_size.height()); |
797 } | 797 } |
798 | 798 |
799 // pending_damage_ is in Surface coordinates. | 799 // pending_damage_ is in Surface coordinates. |
800 gfx::Rect damage_rect = full_damage | 800 gfx::Rect damage_rect = full_damage |
801 ? gfx::Rect(contents_surface_size) | 801 ? gfx::Rect(contents_surface_size) |
802 : gfx::SkIRectToRect(pending_damage_.getBounds()); | 802 : gfx::SkIRectToRect(pending_damage_.getBounds()); |
803 | 803 |
804 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); | 804 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); |
805 render_pass->SetAll(cc::RenderPassId(1, 1), gfx::Rect(contents_surface_size), | 805 render_pass->SetAll(cc::RenderPassId(1, 1), gfx::Rect(contents_surface_size), |
806 damage_rect, gfx::Transform(), true); | 806 damage_rect, gfx::Transform(), cc::FilterOperations(), |
| 807 cc::FilterOperations(), true); |
807 | 808 |
808 gfx::Rect quad_rect = gfx::Rect(contents_surface_size); | 809 gfx::Rect quad_rect = gfx::Rect(contents_surface_size); |
809 cc::SharedQuadState* quad_state = | 810 cc::SharedQuadState* quad_state = |
810 render_pass->CreateAndAppendSharedQuadState(); | 811 render_pass->CreateAndAppendSharedQuadState(); |
811 quad_state->quad_layer_bounds = contents_surface_size; | 812 quad_state->quad_layer_bounds = contents_surface_size; |
812 quad_state->visible_quad_layer_rect = quad_rect; | 813 quad_state->visible_quad_layer_rect = quad_rect; |
813 quad_state->opacity = state_.alpha; | 814 quad_state->opacity = state_.alpha; |
814 | 815 |
815 cc::CompositorFrame frame; | 816 cc::CompositorFrame frame; |
816 if (current_resource_.id) { | 817 if (current_resource_.id) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 | 883 |
883 int64_t Surface::GetPropertyInternal(const void* key, | 884 int64_t Surface::GetPropertyInternal(const void* key, |
884 int64_t default_value) const { | 885 int64_t default_value) const { |
885 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); | 886 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); |
886 if (iter == prop_map_.end()) | 887 if (iter == prop_map_.end()) |
887 return default_value; | 888 return default_value; |
888 return iter->second.value; | 889 return iter->second.value; |
889 } | 890 } |
890 | 891 |
891 } // namespace exo | 892 } // namespace exo |
OLD | NEW |