| 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 "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 WebContentLayerImpl::~WebContentLayerImpl() { | 61 WebContentLayerImpl::~WebContentLayerImpl() { |
| 62 static_cast<PictureLayer*>(layer_->layer())->ClearClient(); | 62 static_cast<PictureLayer*>(layer_->layer())->ClearClient(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 blink::WebLayer* WebContentLayerImpl::layer() { | 65 blink::WebLayer* WebContentLayerImpl::layer() { |
| 66 return layer_.get(); | 66 return layer_.get(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void WebContentLayerImpl::setAllowTransformedRasterization(bool allowed) { |
| 70 static_cast<PictureLayer*>(layer_->layer())->SetAllowTransformedRasterization(
allowed); |
| 71 } |
| 72 |
| 69 gfx::Rect WebContentLayerImpl::PaintableRegion() { | 73 gfx::Rect WebContentLayerImpl::PaintableRegion() { |
| 70 return client_->paintableRegion(); | 74 return client_->paintableRegion(); |
| 71 } | 75 } |
| 72 | 76 |
| 73 scoped_refptr<cc::DisplayItemList> | 77 scoped_refptr<cc::DisplayItemList> |
| 74 WebContentLayerImpl::PaintContentsToDisplayList( | 78 WebContentLayerImpl::PaintContentsToDisplayList( |
| 75 cc::ContentLayerClient::PaintingControlSetting painting_control) { | 79 cc::ContentLayerClient::PaintingControlSetting painting_control) { |
| 76 cc::DisplayItemListSettings settings; | 80 cc::DisplayItemListSettings settings; |
| 77 settings.use_cached_picture = UseCachedPictureRaster(); | 81 settings.use_cached_picture = UseCachedPictureRaster(); |
| 78 | 82 |
| 79 scoped_refptr<cc::DisplayItemList> display_list = | 83 scoped_refptr<cc::DisplayItemList> display_list = |
| 80 cc::DisplayItemList::Create(settings); | 84 cc::DisplayItemList::Create(settings); |
| 81 if (client_) { | 85 if (client_) { |
| 82 WebDisplayItemListImpl list(display_list.get()); | 86 WebDisplayItemListImpl list(display_list.get()); |
| 83 client_->paintContents(&list, PaintingControlToWeb(painting_control)); | 87 client_->paintContents(&list, PaintingControlToWeb(painting_control)); |
| 84 } | 88 } |
| 85 display_list->Finalize(); | 89 display_list->Finalize(); |
| 86 return display_list; | 90 return display_list; |
| 87 } | 91 } |
| 88 | 92 |
| 89 bool WebContentLayerImpl::FillsBoundsCompletely() const { | 93 bool WebContentLayerImpl::FillsBoundsCompletely() const { |
| 90 return false; | 94 return false; |
| 91 } | 95 } |
| 92 | 96 |
| 93 size_t WebContentLayerImpl::GetApproximateUnsharedMemoryUsage() const { | 97 size_t WebContentLayerImpl::GetApproximateUnsharedMemoryUsage() const { |
| 94 return client_->approximateUnsharedMemoryUsage(); | 98 return client_->approximateUnsharedMemoryUsage(); |
| 95 } | 99 } |
| 96 | 100 |
| 97 } // namespace cc_blink | 101 } // namespace cc_blink |
| OLD | NEW |