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

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

Issue 1937493002: cc: 9patch: fix shadow scaling issue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rounded corners Created 4 years, 7 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 | « ui/compositor/layer.h ('k') | ui/wm/core/shadow.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 (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 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 nine_patch_layer_->SetBitmap(bitmap_copy); 624 nine_patch_layer_->SetBitmap(bitmap_copy);
625 } 625 }
626 626
627 void Layer::UpdateNinePatchLayerAperture(const gfx::Rect& aperture_in_dip) { 627 void Layer::UpdateNinePatchLayerAperture(const gfx::Rect& aperture_in_dip) {
628 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get()); 628 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get());
629 nine_patch_layer_aperture_ = aperture_in_dip; 629 nine_patch_layer_aperture_ = aperture_in_dip;
630 gfx::Rect aperture_in_pixel = ConvertRectToPixel(this, aperture_in_dip); 630 gfx::Rect aperture_in_pixel = ConvertRectToPixel(this, aperture_in_dip);
631 nine_patch_layer_->SetAperture(aperture_in_pixel); 631 nine_patch_layer_->SetAperture(aperture_in_pixel);
632 } 632 }
633 633
634 void Layer::UpdateNinePatchLayerBorder(const gfx::Rect& border) {
635 DCHECK_EQ(type_, LAYER_NINE_PATCH);
636 DCHECK(nine_patch_layer_.get());
637 nine_patch_layer_->SetBorder(border);
638 }
639
634 void Layer::UpdateNinePatchOcclusion(const gfx::Rect& occlusion) { 640 void Layer::UpdateNinePatchOcclusion(const gfx::Rect& occlusion) {
635 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get()); 641 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get());
636 nine_patch_layer_->SetLayerOcclusion(occlusion); 642 nine_patch_layer_->SetLayerOcclusion(occlusion);
637 } 643 }
638 644
639 void Layer::SetColor(SkColor color) { GetAnimator()->SetColor(color); } 645 void Layer::SetColor(SkColor color) { GetAnimator()->SetColor(color); }
640 646
641 SkColor Layer::GetTargetColor() { 647 SkColor Layer::GetTargetColor() {
642 if (GetAnimator()->IsAnimatingProperty(LayerAnimationElement::COLOR)) 648 if (GetAnimator()->IsAnimatingProperty(LayerAnimationElement::COLOR))
643 return GetAnimator()->GetTargetColor(); 649 return GetAnimator()->GetTargetColor();
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 if (animator_) { 1027 if (animator_) {
1022 animator_->ResetCompositor(compositor); 1028 animator_->ResetCompositor(compositor);
1023 animator_->RemoveFromCollection(collection); 1029 animator_->RemoveFromCollection(collection);
1024 } 1030 }
1025 1031
1026 for (auto* child : children_) 1032 for (auto* child : children_)
1027 child->ResetCompositorForAnimatorsInTree(compositor); 1033 child->ResetCompositorForAnimatorsInTree(compositor);
1028 } 1034 }
1029 1035
1030 } // namespace ui 1036 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/wm/core/shadow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698