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

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: Split test helpers 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 nine_patch_layer_->SetBitmap(bitmap_copy); 619 nine_patch_layer_->SetBitmap(bitmap_copy);
620 } 620 }
621 621
622 void Layer::UpdateNinePatchLayerAperture(const gfx::Rect& aperture_in_dip) { 622 void Layer::UpdateNinePatchLayerAperture(const gfx::Rect& aperture_in_dip) {
623 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get()); 623 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get());
624 nine_patch_layer_aperture_ = aperture_in_dip; 624 nine_patch_layer_aperture_ = aperture_in_dip;
625 gfx::Rect aperture_in_pixel = ConvertRectToPixel(this, aperture_in_dip); 625 gfx::Rect aperture_in_pixel = ConvertRectToPixel(this, aperture_in_dip);
626 nine_patch_layer_->SetAperture(aperture_in_pixel); 626 nine_patch_layer_->SetAperture(aperture_in_pixel);
627 } 627 }
628 628
629 void Layer::UpdateNinePatchLayerBorder(const gfx::Rect& border) {
630 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get());
oshima 2016/05/13 17:32:50 DCHECK_EQ
llandwerlin-old 2016/05/16 10:05:09 Done.
631 nine_patch_layer_->SetBorder(border);
632 }
633
629 void Layer::UpdateNinePatchOcclusion(const gfx::Rect& occlusion) { 634 void Layer::UpdateNinePatchOcclusion(const gfx::Rect& occlusion) {
630 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get()); 635 DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get());
631 nine_patch_layer_->SetLayerOcclusion(occlusion); 636 nine_patch_layer_->SetLayerOcclusion(occlusion);
632 } 637 }
633 638
634 void Layer::SetColor(SkColor color) { GetAnimator()->SetColor(color); } 639 void Layer::SetColor(SkColor color) { GetAnimator()->SetColor(color); }
635 640
636 SkColor Layer::GetTargetColor() { 641 SkColor Layer::GetTargetColor() {
637 if (GetAnimator()->IsAnimatingProperty(LayerAnimationElement::COLOR)) 642 if (GetAnimator()->IsAnimatingProperty(LayerAnimationElement::COLOR))
638 return GetAnimator()->GetTargetColor(); 643 return GetAnimator()->GetTargetColor();
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 if (animator_) { 1021 if (animator_) {
1017 animator_->ResetCompositor(compositor); 1022 animator_->ResetCompositor(compositor);
1018 animator_->RemoveFromCollection(collection); 1023 animator_->RemoveFromCollection(collection);
1019 } 1024 }
1020 1025
1021 for (auto* child : children_) 1026 for (auto* child : children_)
1022 child->ResetCompositorForAnimatorsInTree(compositor); 1027 child->ResetCompositorForAnimatorsInTree(compositor);
1023 } 1028 }
1024 1029
1025 } // namespace ui 1030 } // 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