OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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("//build/config/features.gni") | 5 import("//build/config/features.gni") |
6 import("//build/config/ui.gni") | 6 import("//build/config/ui.gni") |
7 import("//testing/test.gni") | 7 import("//testing/test.gni") |
8 if (cpu_arch == "arm") { | 8 if (cpu_arch == "arm") { |
9 import("//build/config/arm.gni") | 9 import("//build/config/arm.gni") |
10 } | 10 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 gypi_skia_effects = | 61 gypi_skia_effects = |
62 exec_script("//build/gypi_to_gn.py", | 62 exec_script("//build/gypi_to_gn.py", |
63 [ | 63 [ |
64 rebase_path("//third_party/skia/gyp/effects.gypi"), | 64 rebase_path("//third_party/skia/gyp/effects.gypi"), |
65 "--replace=<(skia_include_path)=//third_party/skia/include", | 65 "--replace=<(skia_include_path)=//third_party/skia/include", |
66 "--replace=<(skia_src_path)=//third_party/skia/src", | 66 "--replace=<(skia_src_path)=//third_party/skia/src", |
67 ], | 67 ], |
68 "scope", | 68 "scope", |
69 [ "//third_party/skia/gyp/effects.gypi" ]) | 69 [ "//third_party/skia/gyp/effects.gypi" ]) |
70 | 70 |
71 # The list of Skia utilss that are to be set for chromium. | 71 # The list of Skia utils that are to be set for chromium. |
72 gypi_skia_utils = | 72 gypi_skia_utils = |
73 exec_script("//build/gypi_to_gn.py", | 73 exec_script("//build/gypi_to_gn.py", |
74 [ | 74 [ |
75 rebase_path("//third_party/skia/gyp/utils.gypi"), | 75 rebase_path("//third_party/skia/gyp/utils.gypi"), |
76 "--replace=<(skia_include_path)=//third_party/skia/include", | 76 "--replace=<(skia_include_path)=//third_party/skia/include", |
77 "--replace=<(skia_src_path)=//third_party/skia/src", | 77 "--replace=<(skia_src_path)=//third_party/skia/src", |
78 ], | 78 ], |
79 "scope", | 79 "scope", |
80 [ "//third_party/skia/gyp/utils.gypi" ]) | 80 [ "//third_party/skia/gyp/utils.gypi" ]) |
81 | 81 |
| 82 gypi_skia_opts = |
| 83 exec_script("//build/gypi_to_gn.py", |
| 84 [ |
| 85 rebase_path("//third_party/skia/gyp/opts.gypi"), |
| 86 "--replace=<(skia_include_path)=//third_party/skia/include", |
| 87 "--replace=<(skia_src_path)=//third_party/skia/src", |
| 88 ], |
| 89 "scope", |
| 90 [ "//third_party/skia/gyp/opts.gypi" ]) |
| 91 |
82 # The list of Skia files is kept in skia_gn_files.gypi. Read it. | 92 # The list of Skia files is kept in skia_gn_files.gypi. Read it. |
83 gypi_values = | 93 gypi_values = |
84 exec_script("//build/gypi_to_gn.py", | 94 exec_script("//build/gypi_to_gn.py", |
85 [ | 95 [ |
86 rebase_path("skia_gn_files.gypi"), | 96 rebase_path("skia_gn_files.gypi"), |
87 "--replace=<(skia_include_path)=//third_party/skia/include", | 97 "--replace=<(skia_include_path)=//third_party/skia/include", |
88 "--replace=<(skia_src_path)=//third_party/skia/src", | 98 "--replace=<(skia_src_path)=//third_party/skia/src", |
89 ], | 99 ], |
90 "scope", | 100 "scope", |
91 [ "skia_gn_files.gypi" ]) | 101 [ "skia_gn_files.gypi" ]) |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 configs += [ "//build/config/compiler:optimize_max" ] | 558 configs += [ "//build/config/compiler:optimize_max" ] |
549 } | 559 } |
550 } | 560 } |
551 | 561 |
552 # Separated out so it can be compiled with different flags for SSE. | 562 # Separated out so it can be compiled with different flags for SSE. |
553 source_set("skia_opts") { | 563 source_set("skia_opts") { |
554 cflags = [] | 564 cflags = [] |
555 defines = [] | 565 defines = [] |
556 | 566 |
557 if (cpu_arch == "x86" || cpu_arch == "x64") { | 567 if (cpu_arch == "x86" || cpu_arch == "x64") { |
558 sources = [ | 568 sources = gypi_skia_opts.sse2_sources + gypi_skia_opts.ssse3_sources + |
559 "//third_party/skia/src/opts/SkTextureCompression_opts_none.cpp", | 569 gypi_skia_opts.sse41_sources + |
560 | 570 [ |
561 # SSE 2 | 571 # Chrome-specific. |
562 "//third_party/skia/src/opts/opts_check_x86.cpp", | 572 "ext/convolver_SSE2.cc", |
563 "//third_party/skia/src/opts/SkBitmapFilter_opts_SSE2.cpp", | 573 ] |
564 "//third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp", | |
565 "//third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp", | |
566 "//third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp", | |
567 "//third_party/skia/src/opts/SkBlurImage_opts_SSE2.cpp", | |
568 "//third_party/skia/src/opts/SkMorphology_opts_SSE2.cpp", | |
569 "//third_party/skia/src/opts/SkUtils_opts_SSE2.cpp", | |
570 "//third_party/skia/src/opts/SkXfermode_opts_SSE2.cpp", | |
571 | |
572 # SSSE 3 | |
573 "//third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp", | |
574 | |
575 # SSE 4 | |
576 "//third_party/skia/src/opts/SkBlurImage_opts_SSE4.cpp", | |
577 | |
578 # Chrome-specific. | |
579 "ext/convolver_SSE2.cc", | |
580 | |
581 # These are header files used by this target from the skia one above. | |
582 "ext/convolver.h", | |
583 "//third_party/skia/include/core/SkTypes.h", | |
584 ] | |
585 | |
586 if (!is_win) { | |
587 # SSE 4 | |
588 if (cpu_arch == "x86") { | |
589 sources += [ "//third_party/skia/src/opts/SkBlitRow_opts_SSE4_asm.S" ] | |
590 } else { # x64 | |
591 sources += | |
592 [ "//third_party/skia/src/opts/SkBlitRow_opts_SSE4_x64_asm.S" ] | |
593 } | |
594 } | |
595 | 574 |
596 if (is_linux || is_mac) { | 575 if (is_linux || is_mac) { |
597 cflags += [ "-msse4.1" ] | 576 cflags += [ "-msse4.1" ] |
598 } | 577 } |
599 } else if (cpu_arch == "arm") { | 578 } else if (cpu_arch == "arm") { |
600 sources = [ | |
601 "//third_party/skia/src/opts/SkBitmapProcState_opts_arm.cpp", | |
602 ] | |
603 | |
604 # The assembly uses the frame pointer register (r7 in Thumb/r11 in | 579 # The assembly uses the frame pointer register (r7 in Thumb/r11 in |
605 # ARM), the compiler doesn't like that. | 580 # ARM), the compiler doesn't like that. |
606 cflags += [ "-fomit-frame-pointer" ] | 581 cflags += [ "-fomit-frame-pointer" ] |
607 | 582 |
608 if (arm_version >= 7) { | 583 if (arm_version >= 7) { |
| 584 sources = gypi_skia_opts.armv7_sources |
609 if (arm_use_neon || arm_optionally_use_neon) { | 585 if (arm_use_neon || arm_optionally_use_neon) { |
610 sources += [ | 586 sources += gypi_skia_opts.neon_sources |
611 "//third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp", | |
612 "//third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp", | |
613 "//third_party/skia/src/opts/SkBitmapProcState_matrix_clamp_neon.h", | |
614 "//third_party/skia/src/opts/SkBitmapProcState_matrix_repeat_neon.h", | |
615 "//third_party/skia/src/opts/SkBlitMask_opts_arm_neon.cpp", | |
616 "//third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp", | |
617 "//third_party/skia/src/opts/SkBlurImage_opts_neon.cpp", | |
618 "//third_party/skia/src/opts/SkMorphology_opts_neon.cpp", | |
619 "//third_party/skia/src/opts/SkTextureCompression_opts_neon.cpp", | |
620 "//third_party/skia/src/opts/SkXfermode_opts_arm_neon.cpp", | |
621 "//third_party/skia/src/opts/memset16_neon.S", | |
622 "//third_party/skia/src/opts/memset32_neon.S", | |
623 ] | |
624 | 587 |
625 # Root build config sets -mfpu=$arm_fpu, which we expect to be neon | 588 # Root build config sets -mfpu=$arm_fpu, which we expect to be neon |
626 # when running this. | 589 # when running this. |
627 if (!arm_use_neon) { | 590 if (!arm_use_neon) { |
628 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] | 591 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
629 cflags += [ "-mfpu=neon" ] | 592 cflags += [ "-mfpu=neon" ] |
630 } | 593 } |
631 | |
632 #ldflags = [ | |
633 # "-march=armv7-a", | |
634 # "-Wl,--fix-cortex-a8", | |
635 #] | |
636 } | 594 } |
637 } | |
638 | |
639 # Non-Neon ARM code. | |
640 if (arm_version < 7 || !arm_use_neon) { | |
641 sources += [ "//third_party/skia/src/opts/memset.arm.S" ] | |
642 } | |
643 | |
644 if (arm_version < 6) { | |
645 sources += [ | |
646 "//third_party/skia/src/opts/SkBlitMask_opts_none.cpp", | |
647 "//third_party/skia/src/opts/SkBlitRow_opts_none.cpp", | |
648 "//third_party/skia/src/opts/SkBlurImage_opts_none.cpp", | |
649 "//third_party/skia/src/opts/SkMorphology_opts_none.cpp", | |
650 "//third_party/skia/src/opts/SkTextureCompression_opts_none.cpp", | |
651 "//third_party/skia/src/opts/SkUtils_opts_none.cpp", | |
652 "//third_party/skia/src/opts/SkXfermode_opts_none.cpp", | |
653 ] | |
654 } else { | 595 } else { |
655 # arm version >= 6. | 596 sources = gypi_skia_opts.none_sourcees |
656 sources += [ | |
657 "//third_party/skia/src/opts/SkBlitMask_opts_arm.cpp", | |
658 "//third_party/skia/src/opts/SkBlitRow_opts_arm.cpp", | |
659 "//third_party/skia/src/opts/SkBlitRow_opts_arm.h", | |
660 "//third_party/skia/src/opts/SkBlurImage_opts_arm.cpp", | |
661 "//third_party/skia/src/opts/SkMorphology_opts_arm.cpp", | |
662 "//third_party/skia/src/opts/SkTextureCompression_opts_arm.cpp", | |
663 "//third_party/skia/src/opts/SkUtils_opts_arm.cpp", | |
664 "//third_party/skia/src/opts/SkXfermode_opts_none.cpp", | |
665 ] | |
666 } | 597 } |
667 } else if (cpu_arch == "mipsel") { | 598 } else if (cpu_arch == "mipsel") { |
668 cflags += [ "-fomit-frame-pointer" ] | 599 cflags += [ "-fomit-frame-pointer" ] |
669 sources = [ | 600 sources = gypi_skia_opts.none_sources |
670 "//third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp", | |
671 "//third_party/skia/src/opts/SkBlitMask_opts_none.cpp", | |
672 "//third_party/skia/src/opts/SkBlitRow_opts_none.cpp", | |
673 "//third_party/skia/src/opts/SkBlurImage_opts_none.cpp", | |
674 "//third_party/skia/src/opts/SkMorphology_opts_none.cpp", | |
675 "//third_party/skia/src/opts/SkTextureCompression_opts_none.cpp", | |
676 "//third_party/skia/src/opts/SkUtils_opts_none.cpp", | |
677 "//third_party/skia/src/opts/SkXfermode_opts_none.cpp", | |
678 ] | |
679 } else { | 601 } else { |
680 assert(false, "Need to port cpu specific stuff from skia_library_opts.gyp") | 602 assert(false, "Need to port cpu specific stuff from skia_library_opts.gyp") |
681 } | 603 } |
682 | 604 |
683 if (is_android && !is_debug) { | 605 if (is_android && !is_debug) { |
684 configs -= [ "//build/config/compiler:optimize" ] | 606 configs -= [ "//build/config/compiler:optimize" ] |
685 configs += [ "//build/config/compiler:optimize_max" ] | 607 configs += [ "//build/config/compiler:optimize_max" ] |
686 } | 608 } |
687 | 609 |
688 configs -= [ "//build/config/compiler:chromium_code" ] | 610 configs -= [ "//build/config/compiler:chromium_code" ] |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 | 646 |
725 deps = [ | 647 deps = [ |
726 ":skia", | 648 ":skia", |
727 "//base", | 649 "//base", |
728 "//base/test:run_all_unittests", | 650 "//base/test:run_all_unittests", |
729 "//testing/gtest", | 651 "//testing/gtest", |
730 "//ui/gfx", | 652 "//ui/gfx", |
731 "//ui/gfx/geometry", | 653 "//ui/gfx/geometry", |
732 ] | 654 ] |
733 } | 655 } |
OLD | NEW |