| 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 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 blink::WebFloatRect web_opaque; | |
| 58 client_->paintContents( | 57 client_->paintContents( |
| 59 canvas, | 58 canvas, |
| 60 clip, | 59 clip, |
| 61 can_use_lcd_text_, | 60 can_use_lcd_text_, |
| 62 web_opaque, // TODO(danakj): Remove this. | |
| 63 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED | 61 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED |
| 64 ? blink::WebContentLayerClient::GraphicsContextEnabled | 62 ? blink::WebContentLayerClient::GraphicsContextEnabled |
| 65 : blink::WebContentLayerClient::GraphicsContextDisabled); | 63 : blink::WebContentLayerClient::GraphicsContextDisabled); |
| 66 } | 64 } |
| 67 | 65 |
| 68 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { | 66 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { |
| 69 // It is important to make this comparison because the LCD text status | 67 // It is important to make this comparison because the LCD text status |
| 70 // here can get out of sync with that in the layer. | 68 // here can get out of sync with that in the layer. |
| 71 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) | 69 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) |
| 72 return; | 70 return; |
| 73 | 71 |
| 74 // LCD text cannot be enabled once disabled. | 72 // LCD text cannot be enabled once disabled. |
| 75 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) | 73 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) |
| 76 return; | 74 return; |
| 77 | 75 |
| 78 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); | 76 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); |
| 79 ignore_lcd_text_change_ = true; | 77 ignore_lcd_text_change_ = true; |
| 80 layer_->invalidate(); | 78 layer_->invalidate(); |
| 81 } | 79 } |
| 82 | 80 |
| 83 bool WebContentLayerImpl::FillsBoundsCompletely() const { | 81 bool WebContentLayerImpl::FillsBoundsCompletely() const { |
| 84 return false; | 82 return false; |
| 85 } | 83 } |
| 86 | 84 |
| 87 } // namespace cc_blink | 85 } // namespace cc_blink |
| OLD | NEW |