| 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/picture_layer.h" |   8 #include "cc/layers/picture_layer.h" | 
|   9 #include "cc/playback/display_item_list_settings.h" |   9 #include "cc/playback/display_item_list_settings.h" | 
|  10 #include "third_party/WebKit/public/platform/WebContentLayerClient.h" |  10 #include "third_party/WebKit/public/platform/WebContentLayerClient.h" | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  47 } |  47 } | 
|  48  |  48  | 
|  49 blink::WebLayer* WebContentLayerImpl::layer() { |  49 blink::WebLayer* WebContentLayerImpl::layer() { | 
|  50   return layer_.get(); |  50   return layer_.get(); | 
|  51 } |  51 } | 
|  52  |  52  | 
|  53 void WebContentLayerImpl::setDoubleSided(bool double_sided) { |  53 void WebContentLayerImpl::setDoubleSided(bool double_sided) { | 
|  54   layer_->layer()->SetDoubleSided(double_sided); |  54   layer_->layer()->SetDoubleSided(double_sided); | 
|  55 } |  55 } | 
|  56  |  56  | 
|  57 void WebContentLayerImpl::PaintContents( |  | 
|  58     SkCanvas* canvas, |  | 
|  59     const gfx::Rect& clip, |  | 
|  60     cc::ContentLayerClient::PaintingControlSetting painting_control) { |  | 
|  61   if (!client_) |  | 
|  62     return; |  | 
|  63  |  | 
|  64   client_->paintContents(canvas, clip, PaintingControlToWeb(painting_control)); |  | 
|  65 } |  | 
|  66  |  | 
|  67 scoped_refptr<cc::DisplayItemList> |  57 scoped_refptr<cc::DisplayItemList> | 
|  68 WebContentLayerImpl::PaintContentsToDisplayList( |  58 WebContentLayerImpl::PaintContentsToDisplayList( | 
|  69     const gfx::Rect& clip, |  59     const gfx::Rect& clip, | 
|  70     cc::ContentLayerClient::PaintingControlSetting painting_control) { |  60     cc::ContentLayerClient::PaintingControlSetting painting_control) { | 
|  71   cc::DisplayItemListSettings settings; |  61   cc::DisplayItemListSettings settings; | 
|  72   settings.use_cached_picture = true; |  62   settings.use_cached_picture = true; | 
|  73  |  63  | 
|  74   scoped_refptr<cc::DisplayItemList> display_list = |  64   scoped_refptr<cc::DisplayItemList> display_list = | 
|  75       cc::DisplayItemList::Create(clip, settings); |  65       cc::DisplayItemList::Create(clip, settings); | 
|  76   if (client_) { |  66   if (client_) { | 
|  77     WebDisplayItemListImpl list(display_list.get()); |  67     WebDisplayItemListImpl list(display_list.get()); | 
|  78     client_->paintContents(&list, clip, PaintingControlToWeb(painting_control)); |  68     client_->paintContents(&list, clip, PaintingControlToWeb(painting_control)); | 
|  79   } |  69   } | 
|  80   display_list->Finalize(); |  70   display_list->Finalize(); | 
|  81   return display_list; |  71   return display_list; | 
|  82 } |  72 } | 
|  83  |  73  | 
|  84 bool WebContentLayerImpl::FillsBoundsCompletely() const { |  74 bool WebContentLayerImpl::FillsBoundsCompletely() const { | 
|  85   return false; |  75   return false; | 
|  86 } |  76 } | 
|  87  |  77  | 
|  88 size_t WebContentLayerImpl::GetApproximateUnsharedMemoryUsage() const { |  78 size_t WebContentLayerImpl::GetApproximateUnsharedMemoryUsage() const { | 
|  89   return client_->approximateUnsharedMemoryUsage(); |  79   return client_->approximateUnsharedMemoryUsage(); | 
|  90 } |  80 } | 
|  91  |  81  | 
|  92 }  // namespace cc_blink |  82 }  // namespace cc_blink | 
| OLD | NEW |