1
- /* Copyright (C) 2006-2015 The Android Open Source Project
1
+ /* Copyright (C) 2006-2016 The Android Open Source Project
2
2
**
3
3
** This software is licensed under the terms of the GNU General Public
4
4
** License version 2, as published by the Free Software Foundation, and
33
33
34
34
#define D (...) do { if (VERBOSE_CHECK(init)) dprint(__VA_ARGS__); } while (0)
35
35
36
- static double get_default_scale ( AndroidOptions * opts );
37
-
38
36
int qemu_net_disable = 0 ;
39
37
40
38
/* EmulatorWindow structure instance. */
@@ -203,7 +201,6 @@ emulator_window_setup( EmulatorWindow* emulator )
203
201
204
202
.window_x = emulator -> win_x ,
205
203
.window_y = emulator -> win_y ,
206
- .window_scale = get_default_scale (emulator -> opts ),
207
204
208
205
.keyboard_charmap = emulator -> opts -> charmap ,
209
206
.keyboard_raw_keys = emulator -> opts -> raw_keys != 0 ,
@@ -432,66 +429,6 @@ get_device_dpi( AndroidOptions* opts )
432
429
return dpi_device ;
433
430
}
434
431
435
- static double
436
- get_default_scale ( AndroidOptions * opts )
437
- {
438
- int dpi_device = get_device_dpi ( opts );
439
- int dpi_monitor = -1 ;
440
- double scale = 0.0 ;
441
-
442
- /* possible values for the 'scale' option are
443
- * 'auto' : try to determine the scale automatically
444
- * '<number>dpi' : indicates the host monitor dpi, compute scale accordingly
445
- * '<fraction>' : use direct scale coefficient
446
- */
447
-
448
- if (opts -> scale ) {
449
- if (!strcmp (opts -> scale , "auto" ))
450
- {
451
- /* we need to get the host dpi resolution ? */
452
- int xdpi , ydpi ;
453
-
454
- if (skin_winsys_get_monitor_dpi (& xdpi , & ydpi ) < 0 ) {
455
- fprintf (stderr , "could not get monitor DPI resolution from system. please use -dpi-monitor to specify one\n" );
456
- exit (1 );
457
- }
458
- D ( "system reported monitor resolutions: xdpi=%d ydpi=%d\n" , xdpi , ydpi );
459
- dpi_monitor = (xdpi + ydpi + 1 )/2 ;
460
- }
461
- else
462
- {
463
- char * end ;
464
- scale = strtod ( opts -> scale , & end );
465
-
466
- if (end && end [0 ] == 'd' && end [1 ] == 'p' && end [2 ] == 'i' && end [3 ] == 0 ) {
467
- if ( scale < 20 || scale > 1000 ) {
468
- fprintf (stderr , "emulator: ignoring bad -scale argument '%s': %s\n" , opts -> scale ,
469
- "host dpi number must be between 20 and 1000" );
470
- exit (1 );
471
- }
472
- dpi_monitor = scale ;
473
- scale = 0.0 ;
474
- }
475
- else if (end == NULL || * end != 0 ) {
476
- fprintf (stderr , "emulator: ignoring bad -scale argument '%s': %s\n" , opts -> scale ,
477
- "not a number or the 'auto' keyword" );
478
- exit (1 );
479
- }
480
- else if ( scale < 0.1 || scale > 3. ) {
481
- fprintf (stderr , "emulator: ignoring bad -window-scale argument '%s': %s\n" , opts -> scale ,
482
- "must be between 0.1 and 3.0" );
483
- exit (1 );
484
- }
485
- }
486
- }
487
-
488
- if (scale == 0.0 && dpi_monitor > 0 )
489
- scale = dpi_monitor * 1.0 /dpi_device ;
490
-
491
- return scale ;
492
- }
493
-
494
-
495
432
/* called periodically to poll for user input events */
496
433
static void emulator_window_refresh (EmulatorWindow * emulator )
497
434
{
@@ -509,23 +446,6 @@ static void emulator_window_refresh(EmulatorWindow* emulator)
509
446
}
510
447
}
511
448
512
- /*
513
- * android-qemu1-glue/console.c helper routines.
514
- */
515
-
516
- void
517
- android_emulator_set_window_scale (double scale , int is_dpi )
518
- {
519
- EmulatorWindow * emulator = qemulator ;
520
-
521
- if (is_dpi )
522
- scale /= get_device_dpi ( emulator -> opts );
523
-
524
- if (emulator -> ui ) {
525
- skin_ui_set_scale (emulator -> ui , scale );
526
- }
527
- }
528
-
529
449
530
450
void
531
451
android_emulator_set_base_port ( int port )
0 commit comments