| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 WebContentLayerImpl::~WebContentLayerImpl() { | 54 WebContentLayerImpl::~WebContentLayerImpl() { |
| 55 static_cast<PictureLayer*>(layer_->layer())->ClearClient(); | 55 static_cast<PictureLayer*>(layer_->layer())->ClearClient(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 blink::WebLayer* WebContentLayerImpl::layer() { | 58 blink::WebLayer* WebContentLayerImpl::layer() { |
| 59 return layer_.get(); | 59 return layer_.get(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void WebContentLayerImpl::setAllowTransformedRasterization(bool allowed) { |
| 63 static_cast<PictureLayer*>(layer_->layer()) |
| 64 ->SetAllowTransformedRasterization(allowed); |
| 65 } |
| 66 |
| 62 gfx::Rect WebContentLayerImpl::PaintableRegion() { | 67 gfx::Rect WebContentLayerImpl::PaintableRegion() { |
| 63 return client_->paintableRegion(); | 68 return client_->paintableRegion(); |
| 64 } | 69 } |
| 65 | 70 |
| 66 scoped_refptr<cc::DisplayItemList> | 71 scoped_refptr<cc::DisplayItemList> |
| 67 WebContentLayerImpl::PaintContentsToDisplayList( | 72 WebContentLayerImpl::PaintContentsToDisplayList( |
| 68 cc::ContentLayerClient::PaintingControlSetting painting_control) { | 73 cc::ContentLayerClient::PaintingControlSetting painting_control) { |
| 69 auto display_list = make_scoped_refptr(new cc::DisplayItemList); | 74 auto display_list = make_scoped_refptr(new cc::DisplayItemList); |
| 70 if (client_) { | 75 if (client_) { |
| 71 WebDisplayItemListImpl list(display_list.get()); | 76 WebDisplayItemListImpl list(display_list.get()); |
| 72 client_->paintContents(&list, PaintingControlToWeb(painting_control)); | 77 client_->paintContents(&list, PaintingControlToWeb(painting_control)); |
| 73 } | 78 } |
| 74 display_list->Finalize(); | 79 display_list->Finalize(); |
| 75 return display_list; | 80 return display_list; |
| 76 } | 81 } |
| 77 | 82 |
| 78 bool WebContentLayerImpl::FillsBoundsCompletely() const { | 83 bool WebContentLayerImpl::FillsBoundsCompletely() const { |
| 79 return false; | 84 return false; |
| 80 } | 85 } |
| 81 | 86 |
| 82 size_t WebContentLayerImpl::GetApproximateUnsharedMemoryUsage() const { | 87 size_t WebContentLayerImpl::GetApproximateUnsharedMemoryUsage() const { |
| 83 return client_->approximateUnsharedMemoryUsage(); | 88 return client_->approximateUnsharedMemoryUsage(); |
| 84 } | 89 } |
| 85 | 90 |
| 86 } // namespace cc_blink | 91 } // namespace cc_blink |
| OLD | NEW |