OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ppapi/shared_impl/ppb_view_shared.h" | 5 #include "ppapi/shared_impl/ppb_view_shared.h" |
6 | 6 |
7 namespace ppapi { | 7 namespace ppapi { |
8 | 8 |
9 ViewData::ViewData() { | 9 ViewData::ViewData() { |
10 // Assume POD. | 10 // Assume POD. |
11 memset(this, 0, sizeof(ViewData)); | 11 memset(this, 0, sizeof(ViewData)); |
12 } | 12 } |
13 | 13 |
14 ViewData::~ViewData() { | 14 ViewData::~ViewData() { |
15 } | 15 } |
16 | 16 |
17 bool ViewData::Equals(const ViewData& other) const { | 17 bool ViewData::Equals(const ViewData& other) const { |
18 return rect.point.x == other.rect.point.x && | 18 return rect.point.x == other.rect.point.x && |
19 rect.point.y == other.rect.point.y && | 19 rect.point.y == other.rect.point.y && |
20 rect.size.width == other.rect.size.width && | 20 rect.size.width == other.rect.size.width && |
21 rect.size.height == other.rect.size.height && | 21 rect.size.height == other.rect.size.height && |
22 is_fullscreen == other.is_fullscreen && | 22 is_fullscreen == other.is_fullscreen && |
23 is_page_visible == other.is_page_visible && | 23 is_page_visible == other.is_page_visible && |
24 clip_rect.point.x == other.clip_rect.point.x && | 24 clip_rect.point.x == other.clip_rect.point.x && |
25 clip_rect.point.y == other.clip_rect.point.y && | 25 clip_rect.point.y == other.clip_rect.point.y && |
26 clip_rect.size.width == other.clip_rect.size.width && | 26 clip_rect.size.width == other.clip_rect.size.width && |
27 clip_rect.size.height == other.clip_rect.size.height; | 27 clip_rect.size.height == other.clip_rect.size.height; |
28 } | 28 } |
29 | 29 |
30 PPB_View_Shared::PPB_View_Shared(const InitAsImpl&, | 30 PPB_View_Shared::PPB_View_Shared(ResourceObjectType type, |
31 PP_Instance instance, | 31 PP_Instance instance, |
32 const ViewData& data) | 32 const ViewData& data) |
33 : Resource(instance), | 33 : Resource(type, instance), |
34 data_(data) { | 34 data_(data) { |
35 } | 35 } |
36 | 36 |
37 PPB_View_Shared::PPB_View_Shared(const InitAsProxy&, | |
38 PP_Instance instance, | |
39 const ViewData& data) | |
40 : Resource(HostResource::MakeInstanceOnly(instance)), | |
41 data_(data) { | |
42 } | |
43 | |
44 PPB_View_Shared::~PPB_View_Shared() { | 37 PPB_View_Shared::~PPB_View_Shared() { |
45 } | 38 } |
46 | 39 |
47 thunk::PPB_View_API* PPB_View_Shared::AsPPB_View_API() { | 40 thunk::PPB_View_API* PPB_View_Shared::AsPPB_View_API() { |
48 return this; | 41 return this; |
49 } | 42 } |
50 | 43 |
51 const ViewData& PPB_View_Shared::GetData() const { | 44 const ViewData& PPB_View_Shared::GetData() const { |
52 return data_; | 45 return data_; |
53 } | 46 } |
54 | 47 |
55 } // namespace ppapi | 48 } // namespace ppapi |
OLD | NEW |