OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CC_STUBS_INTSIZE_H_ | 5 #ifndef CC_STUBS_INTSIZE_H_ |
6 #define CC_STUBS_INTSIZE_H_ | 6 #define CC_STUBS_INTSIZE_H_ |
7 | 7 |
8 #if INSIDE_WEBKIT_BUILD | 8 #if INSIDE_WEBKIT_BUILD |
9 #include "Source/WebCore/platform/graphics/IntSize.h" | 9 #include "Source/WebCore/platform/graphics/IntSize.h" |
10 #else | 10 #else |
11 #include "third_party/WebKit/Source/WebCore/platform/graphics/IntSize.h" | 11 #include "third_party/WebKit/Source/WebCore/platform/graphics/IntSize.h" |
12 #endif | 12 #endif |
13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
| 14 #include "ui/gfx/vector2d.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
16 | 17 |
17 class IntSize : public WebCore::IntSize { | 18 class IntSize : public WebCore::IntSize { |
18 public: | 19 public: |
19 IntSize() { } | 20 IntSize() { } |
20 | 21 |
21 IntSize(int width, int height) | 22 IntSize(int width, int height) |
22 : WebCore::IntSize(width, height) | 23 : WebCore::IntSize(width, height) |
23 { | 24 { |
24 } | 25 } |
25 | 26 |
26 IntSize(WebCore::IntSize size) | 27 IntSize(WebCore::IntSize size) |
27 : WebCore::IntSize(size.width(), size.height()) | 28 : WebCore::IntSize(size.width(), size.height()) |
28 { | 29 { |
29 | 30 |
30 } | 31 } |
31 | 32 |
32 explicit IntSize(gfx::Size size) | 33 explicit IntSize(gfx::Size size) |
33 : WebCore::IntSize(size.width(), size.height()) | 34 : WebCore::IntSize(size.width(), size.height()) |
34 { | 35 { |
35 } | 36 } |
36 | 37 |
| 38 explicit IntSize(gfx::Vector2d vector) |
| 39 : WebCore::IntSize(vector.x(), vector.y()) |
| 40 { |
| 41 } |
| 42 |
37 operator gfx::Size() const { return gfx::Size(width(), height()); } | 43 operator gfx::Size() const { return gfx::Size(width(), height()); } |
| 44 |
| 45 operator gfx::Vector2d() const { return gfx::Vector2d(width(), height()); } |
38 }; | 46 }; |
39 | 47 |
40 } | 48 } |
41 | 49 |
42 #endif | 50 #endif |
OLD | NEW |