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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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
« 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 29 matching lines...) Expand all
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::PaintContents(SkCanvas* canvas, 49 void WebContentLayerImpl::PaintContents(SkCanvas* canvas,
50 gfx::Rect clip, 50 const gfx::Rect& clip,
51 gfx::RectF* opaque) { 51 gfx::RectF* opaque) {
52 if (!client_) 52 if (!client_)
53 return; 53 return;
54 54
55 blink::WebFloatRect web_opaque; 55 blink::WebFloatRect web_opaque;
56 // For picture layers, always record with LCD text. PictureLayerImpl 56 // For picture layers, always record with LCD text. PictureLayerImpl
57 // will turn this off later during rasterization. 57 // will turn this off later during rasterization.
58 bool use_lcd_text = WebLayerImpl::UsingPictureLayer() || can_use_lcd_text_; 58 bool use_lcd_text = WebLayerImpl::UsingPictureLayer() || can_use_lcd_text_;
59 client_->paintContents(canvas, clip, use_lcd_text, web_opaque); 59 client_->paintContents(canvas, clip, use_lcd_text, web_opaque);
60 *opaque = web_opaque; 60 *opaque = web_opaque;
61 } 61 }
62 62
63 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() { 63 void WebContentLayerImpl::DidChangeLayerCanUseLCDText() {
64 // It is important to make this comparison because the LCD text status 64 // It is important to make this comparison because the LCD text status
65 // here can get out of sync with that in the layer. 65 // here can get out of sync with that in the layer.
66 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text()) 66 if (can_use_lcd_text_ == layer_->layer()->can_use_lcd_text())
67 return; 67 return;
68 68
69 // LCD text cannot be enabled once disabled. 69 // LCD text cannot be enabled once disabled.
70 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_) 70 if (layer_->layer()->can_use_lcd_text() && ignore_lcd_text_change_)
71 return; 71 return;
72 72
73 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text(); 73 can_use_lcd_text_ = layer_->layer()->can_use_lcd_text();
74 ignore_lcd_text_change_ = true; 74 ignore_lcd_text_change_ = true;
75 layer_->invalidate(); 75 layer_->invalidate();
76 } 76 }
77 77
78 } // namespace webkit 78 } // 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