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

Side by Side Diff: sky/shell/ios/sky_surface.mm

Issue 1220353002: Add padding values to View.idl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #import "sky_surface.h" 5 #import "sky_surface.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 #import <OpenGLES/EAGL.h> 8 #import <OpenGLES/EAGL.h>
9 #import <OpenGLES/EAGLDrawable.h> 9 #import <OpenGLES/EAGLDrawable.h>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 - (void)layoutSubviews { 79 - (void)layoutSubviews {
80 [super layoutSubviews]; 80 [super layoutSubviews];
81 81
82 [self configureLayerDefaults]; 82 [self configureLayerDefaults];
83 83
84 [self setupPlatformViewIfNecessary]; 84 [self setupPlatformViewIfNecessary];
85 85
86 CGSize size = self.bounds.size; 86 CGSize size = self.bounds.size;
87 CGFloat scale = [UIScreen mainScreen].scale; 87 CGFloat scale = [UIScreen mainScreen].scale;
88 88
89 _sky_engine->OnViewportMetricsChanged(size.width * scale, 89 ViewportMetricsPtr metrics = ViewportMetrics::New();
90 size.height * scale, scale); 90 metrics->physical_width = size.width * scale;
91 metrics->physical_height = size.height * scale;
92 metrics->device_pixel_ratio = scale;
93 _sky_engine->OnViewportMetricsChanged(metrics.Pass());
91 } 94 }
92 95
93 - (void)configureLayerDefaults { 96 - (void)configureLayerDefaults {
94 CAEAGLLayer* layer = reinterpret_cast<CAEAGLLayer*>(self.layer); 97 CAEAGLLayer* layer = reinterpret_cast<CAEAGLLayer*>(self.layer);
95 layer.allowsGroupOpacity = YES; 98 layer.allowsGroupOpacity = YES;
96 layer.opaque = YES; 99 layer.opaque = YES;
97 CGFloat screenScale = [UIScreen mainScreen].scale; 100 CGFloat screenScale = [UIScreen mainScreen].scale;
98 layer.contentsScale = screenScale; 101 layer.contentsScale = screenScale;
99 // Note: shouldRasterize is still NO. This is just a defensive measure 102 // Note: shouldRasterize is still NO. This is just a defensive measure
100 layer.rasterizationScale = screenScale; 103 layer.rasterizationScale = screenScale;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 + (Class)layerClass { 289 + (Class)layerClass {
287 return [CAEAGLLayer class]; 290 return [CAEAGLLayer class];
288 } 291 }
289 292
290 - (void)dealloc { 293 - (void)dealloc {
291 [self notifySurfaceDestruction]; 294 [self notifySurfaceDestruction];
292 [super dealloc]; 295 [super dealloc];
293 } 296 }
294 297
295 @end 298 @end
OLDNEW
« no previous file with comments | « sky/shell/android/org/domokit/sky/shell/SkyActivity.java ('k') | sky/shell/testing/test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698