| 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/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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 layer_->layer()->SetDoubleSided(double_sided); | 43 layer_->layer()->SetDoubleSided(double_sided); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void WebContentLayerImpl::setDrawCheckerboardForMissingTiles(bool enable) { | 46 void WebContentLayerImpl::setDrawCheckerboardForMissingTiles(bool enable) { |
| 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 gfx::RectF* opaque, | |
| 54 ContentLayerClient::GraphicsContextStatus graphics_context_status) { | 53 ContentLayerClient::GraphicsContextStatus graphics_context_status) { |
| 55 if (!client_) | 54 if (!client_) |
| 56 return; | 55 return; |
| 57 | 56 |
| 58 blink::WebFloatRect web_opaque; | 57 blink::WebFloatRect web_opaque; |
| 59 client_->paintContents( | 58 client_->paintContents( |
| 60 canvas, | 59 canvas, |
| 61 clip, | 60 clip, |
| 62 can_use_lcd_text_, | 61 can_use_lcd_text_, |
| 63 web_opaque, | 62 web_opaque, // TODO(danakj): Remove this. |
| 64 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED | 63 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED |
| 65 ? blink::WebContentLayerClient::GraphicsContextEnabled | 64 ? blink::WebContentLayerClient::GraphicsContextEnabled |
| 66 : blink::WebContentLayerClient::GraphicsContextDisabled); | 65 : blink::WebContentLayerClient::GraphicsContextDisabled); |
| 67 *opaque = web_opaque; | |
| 68 } | 66 } |
| 69 | 67 |
| 70 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { | 68 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { |
| 71 // It is important to make this comparison because the LCD text status | 69 // It is important to make this comparison because the LCD text status |
| 72 // here can get out of sync with that in the layer. | 70 // here can get out of sync with that in the layer. |
| 73 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) | 71 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) |
| 74 return; | 72 return; |
| 75 | 73 |
| 76 // LCD text cannot be enabled once disabled. | 74 // LCD text cannot be enabled once disabled. |
| 77 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) | 75 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) |
| 78 return; | 76 return; |
| 79 | 77 |
| 80 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); | 78 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); |
| 81 ignore_lcd_text_change_ = true; | 79 ignore_lcd_text_change_ = true; |
| 82 layer_->invalidate(); | 80 layer_->invalidate(); |
| 83 } | 81 } |
| 84 | 82 |
| 85 bool WebContentLayerImpl::FillsBoundsCompletely() const { | 83 bool WebContentLayerImpl::FillsBoundsCompletely() const { |
| 86 return false; | 84 return false; |
| 87 } | 85 } |
| 88 | 86 |
| 89 } // namespace cc_blink | 87 } // namespace cc_blink |
| OLD | NEW |