Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: webkit/renderer/compositor_bindings/web_content_layer_impl.cc

Issue 315393002: Record SkPicture with correct LCD text setting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-add PictureLayer changes Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 void WebContentLayerImpl::PaintContents( 49 void WebContentLayerImpl::PaintContents(
50 SkCanvas* canvas, 50 SkCanvas* canvas,
51 const gfx::Rect& clip, 51 const gfx::Rect& clip,
52 gfx::RectF* opaque, 52 gfx::RectF* opaque,
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; 57 blink::WebFloatRect web_opaque;
58 // For picture layers, always record with LCD text. PictureLayerImpl
59 // will turn this off later during rasterization.
60 bool use_lcd_text = WebLayerImpl::UsingPictureLayer() || can_use_lcd_text_;
61 client_->paintContents( 58 client_->paintContents(
62 canvas, 59 canvas,
63 clip, 60 clip,
64 use_lcd_text, 61 can_use_lcd_text_,
65 web_opaque, 62 web_opaque,
66 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED 63 graphics_context_status == ContentLayerClient::GRAPHICS_CONTEXT_ENABLED
67 ? blink::WebContentLayerClient::GraphicsContextEnabled 64 ? blink::WebContentLayerClient::GraphicsContextEnabled
68 : blink::WebContentLayerClient::GraphicsContextDisabled); 65 : blink::WebContentLayerClient::GraphicsContextDisabled);
69 *opaque = web_opaque; 66 *opaque = web_opaque;
70 } 67 }
71 68
72 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { 69 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() {
73 // It is important to make this comparison because the LCD text status 70 // It is important to make this comparison because the LCD text status
74 // here can get out of sync with that in the layer. 71 // here can get out of sync with that in the layer.
75 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) 72 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text())
76 return; 73 return;
77 74
78 // LCD text cannot be enabled once disabled. 75 // LCD text cannot be enabled once disabled.
79 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) 76 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_)
80 return; 77 return;
81 78
82 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); 79 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text();
83 ignore_lcd_text_change_ = true; 80 ignore_lcd_text_change_ = true;
84 layer_->invalidate(); 81 layer_->invalidate();
85 } 82 }
86 83
87 bool WebContentLayerImpl::FillsBoundsCompletely() const { return false; } 84 bool WebContentLayerImpl::FillsBoundsCompletely() const { return false; }
88 85
89 } // namespace webkit 86 } // namespace webkit
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698