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 "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 layer_->layer()->SetDrawCheckerboardForMissingTiles(enable); | 47 layer_->layer()->SetDrawCheckerboardForMissingTiles(enable); |
48 } | 48 } |
49 | 49 |
50 void WebContentLayerImpl::PaintContents( | 50 void WebContentLayerImpl::PaintContents( |
51 SkCanvas* canvas, | 51 SkCanvas* canvas, |
52 const gfx::Rect& clip, | 52 const gfx::Rect& clip, |
53 ContentLayerClient::GraphicsContextStatus graphics_context_status) { | 53 ContentLayerClient::GraphicsContextStatus graphics_context_status) { |
54 if (!client_) | 54 if (!client_) |
55 return; | 55 return; |
56 | 56 |
57 // TODO(danakj): Stop passing this to blink it should always use LCD when it | |
58 // wants to. crbug.com/430617 | |
59 bool can_use_lcd_text = true; | |
60 client_->paintContents( | 57 client_->paintContents( |
61 canvas, clip, can_use_lcd_text, | 58 canvas, clip, |
62 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED | 59 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED |
63 ? blink::WebContentLayerClient::GraphicsContextEnabled | 60 ? blink::WebContentLayerClient::GraphicsContextEnabled |
64 : blink::WebContentLayerClient::GraphicsContextDisabled); | 61 : blink::WebContentLayerClient::GraphicsContextDisabled); |
65 } | 62 } |
66 | 63 |
67 scoped_refptr<cc::DisplayItemList> | 64 scoped_refptr<cc::DisplayItemList> |
68 WebContentLayerImpl::PaintContentsToDisplayList( | 65 WebContentLayerImpl::PaintContentsToDisplayList( |
69 const gfx::Rect& clip, | 66 const gfx::Rect& clip, |
70 ContentLayerClient::GraphicsContextStatus graphics_context_status) { | 67 ContentLayerClient::GraphicsContextStatus graphics_context_status) { |
71 if (!client_) | 68 if (!client_) |
72 return cc::DisplayItemList::Create(); | 69 return cc::DisplayItemList::Create(); |
73 | 70 |
74 WebDisplayItemListImpl list; | 71 WebDisplayItemListImpl list; |
75 bool can_use_lcd_text = true; | |
76 client_->paintContents( | 72 client_->paintContents( |
77 &list, clip, can_use_lcd_text, | 73 &list, clip, |
78 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED | 74 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED |
79 ? blink::WebContentLayerClient::GraphicsContextEnabled | 75 ? blink::WebContentLayerClient::GraphicsContextEnabled |
80 : blink::WebContentLayerClient::GraphicsContextDisabled); | 76 : blink::WebContentLayerClient::GraphicsContextDisabled); |
81 return list.ToDisplayItemList(); | 77 return list.ToDisplayItemList(); |
82 } | 78 } |
83 | 79 |
84 bool WebContentLayerImpl::FillsBoundsCompletely() const { | 80 bool WebContentLayerImpl::FillsBoundsCompletely() const { |
85 return false; | 81 return false; |
86 } | 82 } |
87 | 83 |
88 } // namespace cc_blink | 84 } // namespace cc_blink |
OLD | NEW |