| 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/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
| 8 #include "cc/layers/picture_layer.h" | 9 #include "cc/layers/picture_layer.h" |
| 9 #include "third_party/WebKit/public/platform/WebContentLayerClient.h" | 10 #include "third_party/WebKit/public/platform/WebContentLayerClient.h" |
| 10 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 11 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 11 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 12 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
| 12 #include "third_party/WebKit/public/platform/WebRect.h" | 13 #include "third_party/WebKit/public/platform/WebRect.h" |
| 13 #include "third_party/WebKit/public/platform/WebSize.h" | 14 #include "third_party/WebKit/public/platform/WebSize.h" |
| 14 #include "third_party/skia/include/utils/SkMatrix44.h" | 15 #include "third_party/skia/include/utils/SkMatrix44.h" |
| 15 | 16 |
| 16 using cc::ContentLayer; | 17 using cc::ContentLayer; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // TODO(danakj): Stop passing this to blink it should always use LCD when it | 57 // TODO(danakj): Stop passing this to blink it should always use LCD when it |
| 57 // wants to. crbug.com/430617 | 58 // wants to. crbug.com/430617 |
| 58 bool can_use_lcd_text = true; | 59 bool can_use_lcd_text = true; |
| 59 client_->paintContents( | 60 client_->paintContents( |
| 60 canvas, clip, can_use_lcd_text, | 61 canvas, clip, can_use_lcd_text, |
| 61 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED | 62 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED |
| 62 ? blink::WebContentLayerClient::GraphicsContextEnabled | 63 ? blink::WebContentLayerClient::GraphicsContextEnabled |
| 63 : blink::WebContentLayerClient::GraphicsContextDisabled); | 64 : blink::WebContentLayerClient::GraphicsContextDisabled); |
| 64 } | 65 } |
| 65 | 66 |
| 67 scoped_refptr<cc::DisplayItemList> |
| 68 WebContentLayerImpl::PaintContentsToDisplayList( |
| 69 const gfx::Rect& clip, |
| 70 ContentLayerClient::GraphicsContextStatus graphics_context_status) { |
| 71 if (!client_) |
| 72 return cc::DisplayItemList::Create(); |
| 73 |
| 74 WebDisplayItemListImpl list; |
| 75 #if WEB_DISPLAY_ITEM_LIST_IS_DEFINED |
| 76 bool can_use_lcd_text = true; |
| 77 client_->paintContents( |
| 78 &list, clip, can_use_lcd_text, |
| 79 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED |
| 80 ? blink::WebContentLayerClient::GraphicsContextEnabled |
| 81 : blink::WebContentLayerClient::GraphicsContextDisabled); |
| 82 #endif |
| 83 return list.ToDisplayItemList(); |
| 84 } |
| 85 |
| 66 bool WebContentLayerImpl::FillsBoundsCompletely() const { | 86 bool WebContentLayerImpl::FillsBoundsCompletely() const { |
| 67 return false; | 87 return false; |
| 68 } | 88 } |
| 69 | 89 |
| 70 } // namespace cc_blink | 90 } // namespace cc_blink |
| OLD | NEW |