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

Side by Side Diff: cc/stubs/float_quad.h

Issue 11364044: cc: Replace WebCore::FloatQuad with gfx::QuadF. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reeebase. 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/renderer.h ('k') | cc/tiled_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
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_STUBS_FLOATQUAD_H_
6 #define CC_STUBS_FLOATQUAD_H_
7
8 #include "ui/gfx/rect.h"
9 #include "ui/gfx/rect_f.h"
10 #include "FloatPoint.h"
11 #include "FloatRect.h"
12 #if INSIDE_WEBKIT_BUILD
13 #include "Source/WebCore/platform/graphics/FloatQuad.h"
14 #else
15 #include "third_party/WebKit/Source/WebCore/platform/graphics/FloatQuad.h"
16 #endif
17
18 namespace cc {
19
20 class FloatQuad : public WebCore::FloatQuad
21 {
22 public:
23 FloatQuad() { }
24
25 FloatQuad(const FloatPoint& p1, const FloatPoint& p2, const FloatPoint& p3, const FloatPoint& p4)
26 : WebCore::FloatQuad(p1, p2, p3, p4)
27 {
28 }
29
30 FloatQuad(const FloatRect& rect)
31 : WebCore::FloatQuad(rect)
32 {
33 }
34
35 FloatQuad(const IntRect& rect)
36 : WebCore::FloatQuad(rect)
37 {
38 }
39
40 FloatQuad(const WebCore::FloatRect& rect)
41 : WebCore::FloatQuad(rect)
42 {
43 }
44
45 FloatQuad(const WebCore::IntRect& rect)
46 : WebCore::FloatQuad(rect)
47 {
48 }
49
50 FloatQuad(const WebCore::FloatQuad& quad)
51 : WebCore::FloatQuad(quad)
52 {
53 }
54
55 FloatQuad(const gfx::Rect& rect)
56 : WebCore::FloatQuad(WebCore::IntRect(rect.x(), rect.y(), rect.width(), rect.height()))
57 {
58 }
59
60 FloatQuad(const gfx::RectF& rect)
61 : WebCore::FloatQuad(WebCore::FloatRect(rect.x(), rect.y(), rect.width() , rect.height()))
62 {
63 }
64
65 FloatQuad(const gfx::PointF& p1, const gfx::PointF& p2, const gfx::PointF& p 3, const gfx::PointF& p4)
66 : WebCore::FloatQuad(cc::FloatPoint(p1), cc::FloatPoint(p2), cc::FloatPo int(p3), cc::FloatPoint(p4))
67 {
68 }
69
70 cc::FloatPoint p1() const { return cc::FloatPoint(WebCore::FloatQuad::p1()); }
71 cc::FloatPoint p2() const { return cc::FloatPoint(WebCore::FloatQuad::p2()); }
72 cc::FloatPoint p3() const { return cc::FloatPoint(WebCore::FloatQuad::p3()); }
73 cc::FloatPoint p4() const { return cc::FloatPoint(WebCore::FloatQuad::p4()); }
74
75 void setP1(gfx::PointF p) { WebCore::FloatQuad::setP1(cc::FloatPoint(p)); }
76 void setP2(gfx::PointF p) { WebCore::FloatQuad::setP2(cc::FloatPoint(p)); }
77 void setP3(gfx::PointF p) { WebCore::FloatQuad::setP3(cc::FloatPoint(p)); }
78 void setP4(gfx::PointF p) { WebCore::FloatQuad::setP4(cc::FloatPoint(p)); }
79
80 gfx::RectF boundingBox() const { return cc::FloatRect(WebCore::FloatQuad::bo undingBox()); }
81
82 bool containsPoint(gfx::PointF p) { return WebCore::FloatQuad::containsPoint (cc::FloatPoint(p)); }
83 };
84
85 }
86
87 #endif
OLDNEW
« no previous file with comments | « cc/renderer.h ('k') | cc/tiled_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698