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

Side by Side Diff: ppapi/shared_impl/ppb_view_shared.cc

Issue 10544168: Implement HiDPI support in Pepper dev interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to Graphics2DDev C++ header Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
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 #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 device_scale = 1.0;
brettw 2012/06/19 20:21:27 I think you can skip setting these to 1 and just u
Josh Horwich 2012/06/19 23:56:15 Done.
13 css_scale = 1.0;
12 } 14 }
13 15
14 ViewData::~ViewData() { 16 ViewData::~ViewData() {
15 } 17 }
16 18
17 bool ViewData::Equals(const ViewData& other) const { 19 bool ViewData::Equals(const ViewData& other) const {
18 return rect.point.x == other.rect.point.x && 20 return rect.point.x == other.rect.point.x &&
19 rect.point.y == other.rect.point.y && 21 rect.point.y == other.rect.point.y &&
20 rect.size.width == other.rect.size.width && 22 rect.size.width == other.rect.size.width &&
21 rect.size.height == other.rect.size.height && 23 rect.size.height == other.rect.size.height &&
22 is_fullscreen == other.is_fullscreen && 24 is_fullscreen == other.is_fullscreen &&
23 is_page_visible == other.is_page_visible && 25 is_page_visible == other.is_page_visible &&
24 clip_rect.point.x == other.clip_rect.point.x && 26 clip_rect.point.x == other.clip_rect.point.x &&
25 clip_rect.point.y == other.clip_rect.point.y && 27 clip_rect.point.y == other.clip_rect.point.y &&
26 clip_rect.size.width == other.clip_rect.size.width && 28 clip_rect.size.width == other.clip_rect.size.width &&
27 clip_rect.size.height == other.clip_rect.size.height; 29 clip_rect.size.height == other.clip_rect.size.height &&
30 device_scale == other.device_scale &&
31 css_scale == other.css_scale;
28 } 32 }
29 33
30 PPB_View_Shared::PPB_View_Shared(ResourceObjectType type, 34 PPB_View_Shared::PPB_View_Shared(ResourceObjectType type,
31 PP_Instance instance, 35 PP_Instance instance,
32 const ViewData& data) 36 const ViewData& data)
33 : Resource(type, instance), 37 : Resource(type, instance),
34 data_(data) { 38 data_(data) {
35 } 39 }
36 40
37 PPB_View_Shared::~PPB_View_Shared() { 41 PPB_View_Shared::~PPB_View_Shared() {
38 } 42 }
39 43
40 thunk::PPB_View_API* PPB_View_Shared::AsPPB_View_API() { 44 thunk::PPB_View_API* PPB_View_Shared::AsPPB_View_API() {
41 return this; 45 return this;
42 } 46 }
43 47
44 const ViewData& PPB_View_Shared::GetData() const { 48 const ViewData& PPB_View_Shared::GetData() const {
45 return data_; 49 return data_;
46 } 50 }
47 51
48 } // namespace ppapi 52 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698