OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "webkit/renderer/compositor_bindings/web_content_layer_impl.h" | 5 #include "webkit/renderer/compositor_bindings/web_content_layer_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "cc/base/switches.h" | 8 #include "cc/base/switches.h" |
9 #include "cc/layers/content_layer.h" | 9 #include "cc/layers/content_layer.h" |
10 #include "cc/layers/picture_layer.h" | 10 #include "cc/layers/picture_layer.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 return; | 59 return; |
60 | 60 |
61 WebKit::WebFloatRect web_opaque; | 61 WebKit::WebFloatRect web_opaque; |
62 // For picture layers, always record with LCD text. PictureLayerImpl | 62 // For picture layers, always record with LCD text. PictureLayerImpl |
63 // will turn this off later during rasterization. | 63 // will turn this off later during rasterization. |
64 bool use_lcd_text = usingPictureLayer() || can_use_lcd_text_; | 64 bool use_lcd_text = usingPictureLayer() || can_use_lcd_text_; |
65 client_->paintContents(canvas, clip, use_lcd_text, web_opaque); | 65 client_->paintContents(canvas, clip, use_lcd_text, web_opaque); |
66 *opaque = web_opaque; | 66 *opaque = web_opaque; |
67 } | 67 } |
68 | 68 |
69 std::string WebContentLayerImpl::DebugName() { | |
70 return UTF16ToASCII(client_->debugName()); | |
enne (OOO)
2013/07/18 17:50:23
This will assert if the name is not ascii: https:/
jamesr
2013/07/18 18:03:42
You probably want to call utf8() on the string and
| |
71 } | |
72 | |
69 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { | 73 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { |
70 // It is important to make this comparison because the LCD text status | 74 // It is important to make this comparison because the LCD text status |
71 // here can get out of sync with that in the layer. | 75 // here can get out of sync with that in the layer. |
72 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) | 76 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) |
73 return; | 77 return; |
74 | 78 |
75 // LCD text cannot be enabled once disabled. | 79 // LCD text cannot be enabled once disabled. |
76 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) | 80 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) |
77 return; | 81 return; |
78 | 82 |
79 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); | 83 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); |
80 ignore_lcd_text_change_ = true; | 84 ignore_lcd_text_change_ = true; |
81 layer_->invalidate(); | 85 layer_->invalidate(); |
82 } | 86 } |
83 | 87 |
84 } // namespace webkit | 88 } // namespace webkit |
OLD | NEW |