| 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 if (old_surface_id != surface_id_) { | 470 if (old_surface_id != surface_id_) { |
| 471 float contents_surface_to_layer_scale = 1.0; | 471 float contents_surface_to_layer_scale = 1.0; |
| 472 window_->layer()->SetShowSurface( | 472 window_->layer()->SetShowSurface( |
| 473 surface_id_, | 473 surface_id_, |
| 474 base::Bind(&SatisfyCallback, base::Unretained(surface_manager_)), | 474 base::Bind(&SatisfyCallback, base::Unretained(surface_manager_)), |
| 475 base::Bind(&RequireCallback, base::Unretained(surface_manager_)), | 475 base::Bind(&RequireCallback, base::Unretained(surface_manager_)), |
| 476 content_size_, contents_surface_to_layer_scale, content_size_); | 476 content_size_, contents_surface_to_layer_scale, content_size_); |
| 477 window_->layer()->SetBounds( | 477 window_->layer()->SetBounds( |
| 478 gfx::Rect(window_->layer()->bounds().origin(), content_size_)); | 478 gfx::Rect(window_->layer()->bounds().origin(), content_size_)); |
| 479 window_->layer()->SetFillsBoundsOpaquely( | 479 window_->layer()->SetFillsBoundsOpaquely( |
| 480 state_.blend_mode == SkXfermode::kSrc_Mode || | 480 state_.alpha == 1.0f && |
| 481 |
| 481 state_.opaque_region.contains( | 482 state_.opaque_region.contains( |
| 482 gfx::RectToSkIRect(gfx::Rect(content_size_)))); | 483 gfx::RectToSkIRect(gfx::Rect(content_size_)))); |
| 483 } | 484 } |
| 484 | 485 |
| 485 // Reset damage. | 486 // Reset damage. |
| 486 pending_damage_.setEmpty(); | 487 pending_damage_.setEmpty(); |
| 487 | 488 |
| 488 DCHECK(!current_resource_.id || | 489 DCHECK(!current_resource_.id || |
| 489 factory_owner_->release_callbacks_.count(current_resource_.id)); | 490 factory_owner_->release_callbacks_.count(current_resource_.id)); |
| 490 | 491 |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 | 827 |
| 827 int64_t Surface::GetPropertyInternal(const void* key, | 828 int64_t Surface::GetPropertyInternal(const void* key, |
| 828 int64_t default_value) const { | 829 int64_t default_value) const { |
| 829 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); | 830 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); |
| 830 if (iter == prop_map_.end()) | 831 if (iter == prop_map_.end()) |
| 831 return default_value; | 832 return default_value; |
| 832 return iter->second.value; | 833 return iter->second.value; |
| 833 } | 834 } |
| 834 | 835 |
| 835 } // namespace exo | 836 } // namespace exo |
| OLD | NEW |