| 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 "cc/layers/content_layer.h" | 7 #include "cc/layers/content_layer.h" |
| 8 #include "cc/layers/picture_layer.h" | 8 #include "cc/layers/picture_layer.h" |
| 9 #include "third_party/WebKit/public/platform/WebContentLayerClient.h" | 9 #include "third_party/WebKit/public/platform/WebContentLayerClient.h" |
| 10 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 10 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 void WebContentLayerImpl::setDoubleSided(bool double_sided) { | 41 void WebContentLayerImpl::setDoubleSided(bool double_sided) { |
| 42 layer_->layer()->SetDoubleSided(double_sided); | 42 layer_->layer()->SetDoubleSided(double_sided); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void WebContentLayerImpl::setDrawCheckerboardForMissingTiles(bool enable) { | 45 void WebContentLayerImpl::setDrawCheckerboardForMissingTiles(bool enable) { |
| 46 layer_->layer()->SetDrawCheckerboardForMissingTiles(enable); | 46 layer_->layer()->SetDrawCheckerboardForMissingTiles(enable); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void WebContentLayerImpl::PaintContents(SkCanvas* canvas, | 49 void WebContentLayerImpl::PaintContents(SkCanvas* canvas, |
| 50 gfx::Rect clip, | 50 const gfx::Rect& clip, |
| 51 gfx::RectF* opaque) { | 51 gfx::RectF* opaque) { |
| 52 if (!client_) | 52 if (!client_) |
| 53 return; | 53 return; |
| 54 | 54 |
| 55 blink::WebFloatRect web_opaque; | 55 blink::WebFloatRect web_opaque; |
| 56 // For picture layers, always record with LCD text. PictureLayerImpl | 56 // For picture layers, always record with LCD text. PictureLayerImpl |
| 57 // will turn this off later during rasterization. | 57 // will turn this off later during rasterization. |
| 58 bool use_lcd_text = WebLayerImpl::UsingPictureLayer() || can_use_lcd_text_; | 58 bool use_lcd_text = WebLayerImpl::UsingPictureLayer() || can_use_lcd_text_; |
| 59 client_->paintContents(canvas, clip, use_lcd_text, web_opaque); | 59 client_->paintContents(canvas, clip, use_lcd_text, web_opaque); |
| 60 *opaque = web_opaque; | 60 *opaque = web_opaque; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { | 63 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { |
| 64 // It is important to make this comparison because the LCD text status | 64 // It is important to make this comparison because the LCD text status |
| 65 // here can get out of sync with that in the layer. | 65 // here can get out of sync with that in the layer. |
| 66 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) | 66 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) |
| 67 return; | 67 return; |
| 68 | 68 |
| 69 // LCD text cannot be enabled once disabled. | 69 // LCD text cannot be enabled once disabled. |
| 70 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) | 70 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) |
| 71 return; | 71 return; |
| 72 | 72 |
| 73 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); | 73 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); |
| 74 ignore_lcd_text_change_ = true; | 74 ignore_lcd_text_change_ = true; |
| 75 layer_->invalidate(); | 75 layer_->invalidate(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace webkit | 78 } // namespace webkit |
| OLD | NEW |