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

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: fix unit test 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 | components/exo/surface_unittest.cc » ('j') | 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 if (old_surface_id != surface_id_) { 478 if (old_surface_id != surface_id_) {
479 float contents_surface_to_layer_scale = 1.0; 479 float contents_surface_to_layer_scale = 1.0;
480 window_->layer()->SetShowSurface( 480 window_->layer()->SetShowSurface(
481 surface_id_, 481 surface_id_,
482 base::Bind(&SatisfyCallback, base::Unretained(surface_manager_)), 482 base::Bind(&SatisfyCallback, base::Unretained(surface_manager_)),
483 base::Bind(&RequireCallback, base::Unretained(surface_manager_)), 483 base::Bind(&RequireCallback, base::Unretained(surface_manager_)),
484 content_size_, contents_surface_to_layer_scale, content_size_); 484 content_size_, contents_surface_to_layer_scale, content_size_);
485 window_->layer()->SetBounds( 485 window_->layer()->SetBounds(
486 gfx::Rect(window_->layer()->bounds().origin(), content_size_)); 486 gfx::Rect(window_->layer()->bounds().origin(), content_size_));
487 window_->layer()->SetFillsBoundsOpaquely( 487 window_->layer()->SetFillsBoundsOpaquely(
488 state_.alpha == 1.0f && 488 state_.blend_mode == SkXfermode::kSrc_Mode ||
489
490 state_.opaque_region.contains( 489 state_.opaque_region.contains(
491 gfx::RectToSkIRect(gfx::Rect(content_size_)))); 490 gfx::RectToSkIRect(gfx::Rect(content_size_))));
492 } 491 }
493 492
494 // Reset damage. 493 // Reset damage.
495 pending_damage_.setEmpty(); 494 pending_damage_.setEmpty();
496 495
497 DCHECK(!current_resource_.id || 496 DCHECK(!current_resource_.id ||
498 factory_owner_->release_callbacks_.count(current_resource_.id)); 497 factory_owner_->release_callbacks_.count(current_resource_.id));
499 498
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 834
836 int64_t Surface::GetPropertyInternal(const void* key, 835 int64_t Surface::GetPropertyInternal(const void* key,
837 int64_t default_value) const { 836 int64_t default_value) const {
838 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); 837 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key);
839 if (iter == prop_map_.end()) 838 if (iter == prop_map_.end())
840 return default_value; 839 return default_value;
841 return iter->second.value; 840 return iter->second.value;
842 } 841 }
843 842
844 } // namespace exo 843 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | components/exo/surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698