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

Side by Side Diff: cc/scrollbar_layer_impl.cc

Issue 11275113: Remove most remaining references to IntRect and FloatRect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compositor bindings Created 8 years, 1 month 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/scrollbar_layer_impl.h ('k') | cc/solid_color_layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/scrollbar_layer_impl.h" 7 #include "cc/scrollbar_layer_impl.h"
8 8
9 #include "cc/quad_sink.h" 9 #include "cc/quad_sink.h"
10 #include "cc/scrollbar_animation_controller.h" 10 #include "cc/scrollbar_animation_controller.h"
11 #include "cc/texture_draw_quad.h" 11 #include "cc/texture_draw_quad.h"
12 #include "ui/gfx/rect_conversions.h"
12 13
13 using WebKit::WebRect; 14 using WebKit::WebRect;
14 using WebKit::WebScrollbar; 15 using WebKit::WebScrollbar;
15 16
16 namespace cc { 17 namespace cc {
17 18
18 scoped_ptr<ScrollbarLayerImpl> ScrollbarLayerImpl::create(int id) 19 scoped_ptr<ScrollbarLayerImpl> ScrollbarLayerImpl::create(int id)
19 { 20 {
20 return make_scoped_ptr(new ScrollbarLayerImpl(id)); 21 return make_scoped_ptr(new ScrollbarLayerImpl(id));
21 } 22 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 scrollbar->getTickmarks(m_tickmarks); 65 scrollbar->getTickmarks(m_tickmarks);
65 66
66 m_geometry->update(scrollbar); 67 m_geometry->update(scrollbar);
67 } 68 }
68 69
69 static gfx::RectF toUVRect(const gfx::Rect& r, const gfx::Rect& bounds) 70 static gfx::RectF toUVRect(const gfx::Rect& r, const gfx::Rect& bounds)
70 { 71 {
71 return gfx::ScaleRect(r, 1.0 / bounds.width(), 1.0 / bounds.height()); 72 return gfx::ScaleRect(r, 1.0 / bounds.width(), 1.0 / bounds.height());
72 } 73 }
73 74
74 IntRect ScrollbarLayerImpl::scrollbarLayerRectToContentRect(const WebRect& layer Rect) const 75 gfx::Rect ScrollbarLayerImpl::scrollbarLayerRectToContentRect(const gfx::Rect& l ayerRect) const
75 { 76 {
76 // Don't intersect with the bounds as in layerRectToContentRect() because 77 // Don't intersect with the bounds as in layerRectToContentRect() because
77 // layerRect here might be in coordinates of the containing layer. 78 // layerRect here might be in coordinates of the containing layer.
78 FloatRect contentRect(layerRect.x, layerRect.y, layerRect.width, layerRect.h eight); 79 gfx::RectF contentRect = gfx::ScaleRect(layerRect, contentsScaleX(), content sScaleY());
79 contentRect.scale(contentsScaleX(), contentsScaleY()); 80 return gfx::ToEnclosingRect(contentRect);
80 return enclosingIntRect(contentRect);
81 } 81 }
82 82
83 void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append QuadsData) 83 void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append QuadsData)
84 { 84 {
85 bool premultipledAlpha = false; 85 bool premultipledAlpha = false;
86 bool flipped = false; 86 bool flipped = false;
87 gfx::RectF uvRect(0, 0, 1, 1); 87 gfx::RectF uvRect(0, 0, 1, 1);
88 gfx::Rect boundsRect(gfx::Point(), bounds()); 88 gfx::Rect boundsRect(gfx::Point(), bounds());
89 gfx::Rect contentBoundsRect(gfx::Point(), contentBounds()); 89 gfx::Rect contentBoundsRect(gfx::Point(), contentBounds());
90 90
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 { 201 {
202 return m_owner->m_isCustomScrollbar; 202 return m_owner->m_isCustomScrollbar;
203 } 203 }
204 204
205 const char* ScrollbarLayerImpl::layerTypeAsString() const 205 const char* ScrollbarLayerImpl::layerTypeAsString() const
206 { 206 {
207 return "ScrollbarLayer"; 207 return "ScrollbarLayer";
208 } 208 }
209 209
210 } 210 }
OLDNEW
« no previous file with comments | « cc/scrollbar_layer_impl.h ('k') | cc/solid_color_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698