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

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

Issue 253013003: Enable disabling WebCore::GraphicsContext in telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed git issues. Created 6 years, 7 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
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::setHasGpuRasterizationHint(bool has_hint) { 49 void WebContentLayerImpl::setHasGpuRasterizationHint(bool has_hint) {
50 if (WebLayerImpl::UsingPictureLayer()) { 50 if (WebLayerImpl::UsingPictureLayer()) {
51 static_cast<PictureLayer*>(layer_->layer()) 51 static_cast<PictureLayer*>(layer_->layer())
52 ->SetHasGpuRasterizationHint(has_hint); 52 ->SetHasGpuRasterizationHint(has_hint);
53 } 53 }
54 } 54 }
55 55
56 void WebContentLayerImpl::PaintContents(SkCanvas* canvas, 56 void WebContentLayerImpl::PaintContents(SkCanvas* canvas,
57 const gfx::Rect& clip, 57 const gfx::Rect& clip,
58 gfx::RectF* opaque) { 58 gfx::RectF* opaque,
59 bool disableContext) {
59 if (!client_) 60 if (!client_)
60 return; 61 return;
61 62
62 blink::WebFloatRect web_opaque; 63 blink::WebFloatRect web_opaque;
63 // For picture layers, always record with LCD text. PictureLayerImpl 64 // For picture layers, always record with LCD text. PictureLayerImpl
64 // will turn this off later during rasterization. 65 // will turn this off later during rasterization.
65 bool use_lcd_text = WebLayerImpl::UsingPictureLayer() || can_use_lcd_text_; 66 bool use_lcd_text = WebLayerImpl::UsingPictureLayer() || can_use_lcd_text_;
66 client_->paintContents(canvas, clip, use_lcd_text, web_opaque); 67 client_->paintContents(
68 canvas, clip, use_lcd_text, web_opaque, disableContext);
67 *opaque = web_opaque; 69 *opaque = web_opaque;
68 } 70 }
69 71
70 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { 72 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() {
71 // It is important to make this comparison because the LCD text status 73 // It is important to make this comparison because the LCD text status
72 // here can get out of sync with that in the layer. 74 // here can get out of sync with that in the layer.
73 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) 75 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text())
74 return; 76 return;
75 77
76 // LCD text cannot be enabled once disabled. 78 // LCD text cannot be enabled once disabled.
77 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) 79 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_)
78 return; 80 return;
79 81
80 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); 82 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text();
81 ignore_lcd_text_change_ = true; 83 ignore_lcd_text_change_ = true;
82 layer_->invalidate(); 84 layer_->invalidate();
83 } 85 }
84 86
85 bool WebContentLayerImpl::FillsBoundsCompletely() const { return false; } 87 bool WebContentLayerImpl::FillsBoundsCompletely() const { return false; }
86 88
87 } // namespace webkit 89 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698