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

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

Issue 2101453002: Re-land: 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_.alpha == 1.0f && 480 state_.blend_mode == SkXfermode::kSrc_Mode ||
jbauman 2016/06/27 20:51:41 So if the blend mode is SkXfermode::kSrc_Mode then
reveman 2016/06/27 20:54:21 We should probably define this as part of the alph
481
482 state_.opaque_region.contains( 481 state_.opaque_region.contains(
483 gfx::RectToSkIRect(gfx::Rect(content_size_)))); 482 gfx::RectToSkIRect(gfx::Rect(content_size_))));
484 } 483 }
485 484
486 // Reset damage. 485 // Reset damage.
487 pending_damage_.setEmpty(); 486 pending_damage_.setEmpty();
488 487
489 DCHECK(!current_resource_.id || 488 DCHECK(!current_resource_.id ||
490 factory_owner_->release_callbacks_.count(current_resource_.id)); 489 factory_owner_->release_callbacks_.count(current_resource_.id));
491 490
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 826
828 int64_t Surface::GetPropertyInternal(const void* key, 827 int64_t Surface::GetPropertyInternal(const void* key,
829 int64_t default_value) const { 828 int64_t default_value) const {
830 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); 829 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key);
831 if (iter == prop_map_.end()) 830 if (iter == prop_map_.end())
832 return default_value; 831 return default_value;
833 return iter->second.value; 832 return iter->second.value;
834 } 833 }
835 834
836 } // namespace exo 835 } // 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