| 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 "cc/blink/web_display_item_list_impl.h" | 7 #include "cc/blink/web_display_item_list_impl.h" |
| 8 #include "cc/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
| 9 #include "cc/layers/picture_layer.h" | 9 #include "cc/layers/picture_layer.h" |
| 10 #include "cc/playback/display_item_list_settings.h" | 10 #include "cc/playback/display_item_list_settings.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 return blink::WebContentLayerClient::DisplayListCachingDisabled; | 32 return blink::WebContentLayerClient::DisplayListCachingDisabled; |
| 33 case cc::ContentLayerClient::DISPLAY_LIST_PAINTING_DISABLED: | 33 case cc::ContentLayerClient::DISPLAY_LIST_PAINTING_DISABLED: |
| 34 return blink::WebContentLayerClient::DisplayListPaintingDisabled; | 34 return blink::WebContentLayerClient::DisplayListPaintingDisabled; |
| 35 } | 35 } |
| 36 NOTREACHED(); | 36 NOTREACHED(); |
| 37 return blink::WebContentLayerClient::PaintDefaultBehavior; | 37 return blink::WebContentLayerClient::PaintDefaultBehavior; |
| 38 } | 38 } |
| 39 | 39 |
| 40 WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client) | 40 WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client) |
| 41 : client_(client) { | 41 : client_(client) { |
| 42 if (WebLayerImpl::UsingPictureLayer()) | 42 layer_ = make_scoped_ptr(new WebLayerImpl( |
| 43 layer_ = make_scoped_ptr(new WebLayerImpl( | 43 PictureLayer::Create(WebLayerImpl::LayerSettings(), this))); |
| 44 PictureLayer::Create(WebLayerImpl::LayerSettings(), this))); | |
| 45 else | |
| 46 layer_ = make_scoped_ptr(new WebLayerImpl( | |
| 47 ContentLayer::Create(WebLayerImpl::LayerSettings(), this))); | |
| 48 layer_->layer()->SetIsDrawable(true); | 44 layer_->layer()->SetIsDrawable(true); |
| 49 } | 45 } |
| 50 | 46 |
| 51 WebContentLayerImpl::~WebContentLayerImpl() { | 47 WebContentLayerImpl::~WebContentLayerImpl() { |
| 52 if (WebLayerImpl::UsingPictureLayer()) | 48 static_cast<PictureLayer*>(layer_->layer())->ClearClient(); |
| 53 static_cast<PictureLayer*>(layer_->layer())->ClearClient(); | |
| 54 else | |
| 55 static_cast<ContentLayer*>(layer_->layer())->ClearClient(); | |
| 56 } | 49 } |
| 57 | 50 |
| 58 blink::WebLayer* WebContentLayerImpl::layer() { | 51 blink::WebLayer* WebContentLayerImpl::layer() { |
| 59 return layer_.get(); | 52 return layer_.get(); |
| 60 } | 53 } |
| 61 | 54 |
| 62 void WebContentLayerImpl::setDoubleSided(bool double_sided) { | 55 void WebContentLayerImpl::setDoubleSided(bool double_sided) { |
| 63 layer_->layer()->SetDoubleSided(double_sided); | 56 layer_->layer()->SetDoubleSided(double_sided); |
| 64 } | 57 } |
| 65 | 58 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 92 } | 85 } |
| 93 display_list->Finalize(); | 86 display_list->Finalize(); |
| 94 return display_list; | 87 return display_list; |
| 95 } | 88 } |
| 96 | 89 |
| 97 bool WebContentLayerImpl::FillsBoundsCompletely() const { | 90 bool WebContentLayerImpl::FillsBoundsCompletely() const { |
| 98 return false; | 91 return false; |
| 99 } | 92 } |
| 100 | 93 |
| 101 } // namespace cc_blink | 94 } // namespace cc_blink |
| OLD | NEW |