| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "webkit/compositor_bindings/web_nine_patch_layer_impl.h" | 5 #include "webkit/compositor_bindings/web_nine_patch_layer_impl.h" |
| 6 | 6 |
| 7 #include "cc/nine_patch_layer.h" | 7 #include "cc/nine_patch_layer.h" |
| 8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 #include "webkit/compositor_bindings/web_layer_impl.h" | 10 #include "webkit/compositor_bindings/web_layer_impl.h" |
| 11 | 11 |
| 12 using cc::NinePatchLayer; | 12 using cc::NinePatchLayer; |
| 13 | 13 |
| 14 namespace WebKit { | 14 namespace webkit { |
| 15 | 15 |
| 16 WebNinePatchLayerImpl::WebNinePatchLayerImpl() | 16 WebNinePatchLayerImpl::WebNinePatchLayerImpl() |
| 17 : layer_(new WebLayerImpl(NinePatchLayer::Create())) { | 17 : layer_(new WebLayerImpl(NinePatchLayer::Create())) { |
| 18 layer_->layer()->SetIsDrawable(true); | 18 layer_->layer()->SetIsDrawable(true); |
| 19 } | 19 } |
| 20 | 20 |
| 21 WebNinePatchLayerImpl::~WebNinePatchLayerImpl() {} | 21 WebNinePatchLayerImpl::~WebNinePatchLayerImpl() {} |
| 22 | 22 |
| 23 WebLayer* WebNinePatchLayerImpl::layer() { return layer_.get(); } | 23 WebKit::WebLayer* WebNinePatchLayerImpl::layer() { return layer_.get(); } |
| 24 | 24 |
| 25 void WebNinePatchLayerImpl::setBitmap(const SkBitmap& bitmap, | 25 void WebNinePatchLayerImpl::setBitmap(const SkBitmap& bitmap, |
| 26 const WebRect& aperture) { | 26 const WebKit::WebRect& aperture) { |
| 27 static_cast<NinePatchLayer*>(layer_->layer())->SetBitmap(bitmap, | 27 static_cast<NinePatchLayer*>(layer_->layer())->SetBitmap(bitmap, |
| 28 gfx::Rect(aperture)); | 28 gfx::Rect(aperture)); |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace WebKit | 31 } // namespace WebKit |
| OLD | NEW |