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

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

Issue 192973002: Add a GPU rasterization hint to cc::PictureLayer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 9 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 | « webkit/renderer/compositor_bindings/web_content_layer_impl.h ('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 28 matching lines...) Expand all
39 blink::WebLayer* WebContentLayerImpl::layer() { return layer_.get(); } 39 blink::WebLayer* WebContentLayerImpl::layer() { return layer_.get(); }
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::setHasGpuRasterizationHint(bool has_hint) {
50 if (WebLayerImpl::UsingPictureLayer()) {
51 static_cast<PictureLayer*>(layer_->layer())
52 ->SetHasGpuRasterizationHint(has_hint);
53 }
54 }
55
49 void WebContentLayerImpl::PaintContents(SkCanvas* canvas, 56 void WebContentLayerImpl::PaintContents(SkCanvas* canvas,
50 const gfx::Rect& clip, 57 const gfx::Rect& clip,
51 gfx::RectF* opaque) { 58 gfx::RectF* opaque) {
52 if (!client_) 59 if (!client_)
53 return; 60 return;
54 61
55 blink::WebFloatRect web_opaque; 62 blink::WebFloatRect web_opaque;
56 // For picture layers, always record with LCD text. PictureLayerImpl 63 // For picture layers, always record with LCD text. PictureLayerImpl
57 // will turn this off later during rasterization. 64 // will turn this off later during rasterization.
58 bool use_lcd_text = WebLayerImpl::UsingPictureLayer() || can_use_lcd_text_; 65 bool use_lcd_text = WebLayerImpl::UsingPictureLayer() || can_use_lcd_text_;
(...skipping 10 matching lines...) Expand all
69 // LCD text cannot be enabled once disabled. 76 // LCD text cannot be enabled once disabled.
70 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) 77 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_)
71 return; 78 return;
72 79
73 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); 80 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text();
74 ignore_lcd_text_change_ = true; 81 ignore_lcd_text_change_ = true;
75 layer_->invalidate(); 82 layer_->invalidate();
76 } 83 }
77 84
78 } // namespace webkit 85 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/renderer/compositor_bindings/web_content_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698