| 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_content_layer_impl.h" | 5 #include "cc/blink/web_content_layer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "cc/base/switches.h" | 10 #include "cc/base/switches.h" |
| 11 #include "cc/blink/web_display_item_list_impl.h" | 11 #include "cc/blink/web_display_item_list_impl.h" |
| 12 #include "cc/layers/layer_settings.h" |
| 12 #include "cc/layers/picture_layer.h" | 13 #include "cc/layers/picture_layer.h" |
| 13 #include "cc/playback/display_item_list_settings.h" | 14 #include "cc/playback/display_item_list_settings.h" |
| 14 #include "third_party/WebKit/public/platform/WebContentLayerClient.h" | 15 #include "third_party/WebKit/public/platform/WebContentLayerClient.h" |
| 15 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 16 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 16 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 17 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
| 17 #include "third_party/WebKit/public/platform/WebRect.h" | 18 #include "third_party/WebKit/public/platform/WebRect.h" |
| 18 #include "third_party/WebKit/public/platform/WebSize.h" | 19 #include "third_party/WebKit/public/platform/WebSize.h" |
| 19 #include "third_party/skia/include/utils/SkMatrix44.h" | 20 #include "third_party/skia/include/utils/SkMatrix44.h" |
| 20 | 21 |
| 21 using cc::PictureLayer; | 22 using cc::PictureLayer; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 return blink::WebContentLayerClient::DisplayListPaintingDisabled; | 45 return blink::WebContentLayerClient::DisplayListPaintingDisabled; |
| 45 case cc::ContentLayerClient::SUBSEQUENCE_CACHING_DISABLED: | 46 case cc::ContentLayerClient::SUBSEQUENCE_CACHING_DISABLED: |
| 46 return blink::WebContentLayerClient::SubsequenceCachingDisabled; | 47 return blink::WebContentLayerClient::SubsequenceCachingDisabled; |
| 47 } | 48 } |
| 48 NOTREACHED(); | 49 NOTREACHED(); |
| 49 return blink::WebContentLayerClient::PaintDefaultBehavior; | 50 return blink::WebContentLayerClient::PaintDefaultBehavior; |
| 50 } | 51 } |
| 51 | 52 |
| 52 WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client) | 53 WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client) |
| 53 : client_(client) { | 54 : client_(client) { |
| 54 layer_ = make_scoped_ptr(new WebLayerImpl( | 55 layer_ = make_scoped_ptr( |
| 55 PictureLayer::Create(WebLayerImpl::LayerSettings(), this))); | 56 new WebLayerImpl(PictureLayer::Create(cc::LayerSettings(), this))); |
| 56 layer_->layer()->SetIsDrawable(true); | 57 layer_->layer()->SetIsDrawable(true); |
| 57 } | 58 } |
| 58 | 59 |
| 59 WebContentLayerImpl::~WebContentLayerImpl() { | 60 WebContentLayerImpl::~WebContentLayerImpl() { |
| 60 static_cast<PictureLayer*>(layer_->layer())->ClearClient(); | 61 static_cast<PictureLayer*>(layer_->layer())->ClearClient(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 blink::WebLayer* WebContentLayerImpl::layer() { | 64 blink::WebLayer* WebContentLayerImpl::layer() { |
| 64 return layer_.get(); | 65 return layer_.get(); |
| 65 } | 66 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 86 | 87 |
| 87 bool WebContentLayerImpl::FillsBoundsCompletely() const { | 88 bool WebContentLayerImpl::FillsBoundsCompletely() const { |
| 88 return false; | 89 return false; |
| 89 } | 90 } |
| 90 | 91 |
| 91 size_t WebContentLayerImpl::GetApproximateUnsharedMemoryUsage() const { | 92 size_t WebContentLayerImpl::GetApproximateUnsharedMemoryUsage() const { |
| 92 return client_->approximateUnsharedMemoryUsage(); | 93 return client_->approximateUnsharedMemoryUsage(); |
| 93 } | 94 } |
| 94 | 95 |
| 95 } // namespace cc_blink | 96 } // namespace cc_blink |
| OLD | NEW |