| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/blink/web_layer_impl.h" | 5 #include "cc/blink/web_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event_impl.h" | 8 #include "base/debug/trace_event_impl.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 // static | 71 // static |
| 72 void WebLayerImpl::SetImplSidePaintingEnabled(bool enabled) { | 72 void WebLayerImpl::SetImplSidePaintingEnabled(bool enabled) { |
| 73 g_impl_side_painting_enabled = enabled; | 73 g_impl_side_painting_enabled = enabled; |
| 74 } | 74 } |
| 75 | 75 |
| 76 int WebLayerImpl::id() const { | 76 int WebLayerImpl::id() const { |
| 77 return layer_->id(); | 77 return layer_->id(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void WebLayerImpl::invalidateRect(const blink::WebFloatRect& rect) { | |
| 81 layer_->SetNeedsDisplayRect(gfx::ToEnclosingRect(rect)); | |
| 82 } | |
| 83 | |
| 84 void WebLayerImpl::invalidateRect(const blink::WebRect& rect) { | 80 void WebLayerImpl::invalidateRect(const blink::WebRect& rect) { |
| 85 layer_->SetNeedsDisplayRect(rect); | 81 layer_->SetNeedsDisplayRect(rect); |
| 86 } | 82 } |
| 87 | 83 |
| 88 void WebLayerImpl::invalidate() { | 84 void WebLayerImpl::invalidate() { |
| 89 layer_->SetNeedsDisplay(); | 85 layer_->SetNeedsDisplay(); |
| 90 } | 86 } |
| 91 | 87 |
| 92 void WebLayerImpl::addChild(WebLayer* child) { | 88 void WebLayerImpl::addChild(WebLayer* child) { |
| 93 layer_->AddChild(static_cast<WebLayerImpl*>(child)->layer()); | 89 layer_->AddChild(static_cast<WebLayerImpl*>(child)->layer()); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 if (parent) | 473 if (parent) |
| 478 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); | 474 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); |
| 479 layer_->SetClipParent(clip_parent); | 475 layer_->SetClipParent(clip_parent); |
| 480 } | 476 } |
| 481 | 477 |
| 482 Layer* WebLayerImpl::layer() const { | 478 Layer* WebLayerImpl::layer() const { |
| 483 return layer_.get(); | 479 return layer_.get(); |
| 484 } | 480 } |
| 485 | 481 |
| 486 } // namespace cc_blink | 482 } // namespace cc_blink |
| OLD | NEW |