Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: components/exo/surface.cc

Issue 2109703002: Revert of exo: Take blending into account when setting opaque property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698