Chromium Code Reviews| Index: ui/compositor/layer.cc |
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
| index c1767422163a523d837632b6183a6100b5dab2cc..1450b15e6dde85387e66a21a2ff903bdfdb85cf0 100644 |
| --- a/ui/compositor/layer.cc |
| +++ b/ui/compositor/layer.cc |
| @@ -14,6 +14,7 @@ |
| #include "cc/base/scoped_ptr_algorithm.h" |
| #include "cc/layers/content_layer.h" |
| #include "cc/layers/delegated_renderer_layer.h" |
| +#include "cc/layers/nine_patch_layer.h" |
| #include "cc/layers/picture_layer.h" |
| #include "cc/layers/solid_color_layer.h" |
| #include "cc/layers/texture_layer.h" |
| @@ -583,6 +584,18 @@ void Layer::SetShowPaintedContent() { |
| RecomputeDrawsContentAndUVRect(); |
| } |
| +void Layer::UpdateNinePatchLayer(const SkBitmap& bitmap, |
| + const gfx::Rect& aperture, |
| + const gfx::Rect& border) { |
| + DCHECK(nine_patch_layer_.get()); |
| + if (!nine_patch_layer_.get()) |
|
danakj
2014/07/15 17:53:34
You DCHECK'd this won't happen, so please don't tr
sky
2014/07/15 17:55:18
It would also be nice if you could dcheck on the t
hshi1
2014/07/15 18:16:39
Done.
hshi1
2014/07/15 18:16:39
Done.
|
| + return; |
| + |
| + nine_patch_layer_->SetBitmap(bitmap); |
| + nine_patch_layer_->SetAperture(aperture); |
| + nine_patch_layer_->SetBorder(border); |
| +} |
| + |
| void Layer::SetColor(SkColor color) { GetAnimator()->SetColor(color); } |
| bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) { |
| @@ -927,6 +940,9 @@ void Layer::CreateWebLayer() { |
| if (type_ == LAYER_SOLID_COLOR) { |
| solid_color_layer_ = cc::SolidColorLayer::Create(); |
| cc_layer_ = solid_color_layer_.get(); |
| + } else if (type_ == LAYER_NINE_PATCH) { |
| + nine_patch_layer_ = cc::NinePatchLayer::Create(); |
| + cc_layer_ = nine_patch_layer_.get(); |
| } else { |
| if (Layer::UsingPictureLayer()) |
| content_layer_ = cc::PictureLayer::Create(this); |