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

Side by Side Diff: ui/compositor/layer.cc

Issue 317663005: Scale the ALPHA_THRESHOLD filter's region based on the device scale factor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove call to SetAlphaShape from this cl Created 6 years, 6 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 | Annotate | Revision Log
« ui/compositor/layer.h ('K') | « ui/compositor/layer.h ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 filters.Append(cc::FilterOperation::CreateInvertFilter(1.0)); 369 filters.Append(cc::FilterOperation::CreateInvertFilter(1.0));
370 // Brightness goes last, because the resulting colors neeed clamping, which 370 // Brightness goes last, because the resulting colors neeed clamping, which
371 // cause further color matrix filters to be applied separately. In this order, 371 // cause further color matrix filters to be applied separately. In this order,
372 // they all can be combined in a single pass. 372 // they all can be combined in a single pass.
373 if (layer_brightness_) { 373 if (layer_brightness_) {
374 filters.Append(cc::FilterOperation::CreateSaturatingBrightnessFilter( 374 filters.Append(cc::FilterOperation::CreateSaturatingBrightnessFilter(
375 layer_brightness_)); 375 layer_brightness_));
376 } 376 }
377 if (alpha_shape_) { 377 if (alpha_shape_) {
378 filters.Append(cc::FilterOperation::CreateAlphaThresholdFilter( 378 filters.Append(cc::FilterOperation::CreateAlphaThresholdFilter(
379 *alpha_shape_, 1.f, 0.f)); 379 *alpha_shape_, device_scale_factor_, 1.f, 0.f));
380 } 380 }
381 381
382 cc_layer_->SetFilters(filters); 382 cc_layer_->SetFilters(filters);
383 } 383 }
384 384
385 void Layer::SetLayerBackgroundFilters() { 385 void Layer::SetLayerBackgroundFilters() {
386 cc::FilterOperations filters; 386 cc::FilterOperations filters;
387 if (zoom_ != 1) 387 if (zoom_ != 1)
388 filters.Append(cc::FilterOperation::CreateZoomFilter(zoom_, zoom_inset_)); 388 filters.Append(cc::FilterOperation::CreateZoomFilter(zoom_, zoom_inset_));
389 389
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 children_.end(), 988 children_.end(),
989 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), 989 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection),
990 collection)); 990 collection));
991 } 991 }
992 992
993 bool Layer::IsAnimating() const { 993 bool Layer::IsAnimating() const {
994 return animator_ && animator_->is_animating(); 994 return animator_ && animator_->is_animating();
995 } 995 }
996 996
997 } // namespace ui 997 } // namespace ui
OLDNEW
« ui/compositor/layer.h ('K') | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698