1. 18 Jun, 2019 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Support font driver supersession · 64767008
      YAMAMOTO Mitsuharu authored
      * src/font.c (font_update_drivers): If argument NEW_DRIVERS is t, then don't
      use superseded drivers.
      (syms_of_font) <Qfont_driver_superseded_by>: New DEFSYM.
      
      * src/ftfont.c (syms_of_ftfont) [HAVE_HARFBUZZ]:
      * src/ftcrfont.c (syms_of_ftcrfont) [HAVE_HARFBUZZ]:
      * src/w32font.c (syms_of_w32font) [HAVE_HARFBUZZ]:
      * src/xftfont.c (syms_of_xftfont) [HAVE_HARFBUZZ]: Make Harfbuzz variants
      supersede non-Harfbuzz ones.
      
      * src/w32fns.c (Fx_create_frame, w32_create_tip_frame): Remove font backend
      determination code.
      64767008
  2. 17 Jun, 2019 2 commits
  3. 16 Jun, 2019 5 commits
    • Lars Ingebrigtsen's avatar
      Fix up the --no-print-directory changes in src/Makefile.in · fd9cff02
      Lars Ingebrigtsen authored
      * src/Makefile.in (AM_V_NO_PD): New macro written by Andreas
      Schwab that can be either --no-print-directory or "".
      (%.elc): Use it instead if the if statement.
      fd9cff02
    • Juanma Barranquero's avatar
      Bump up max_specpdl_size to 1500. (Bug#36216) · 4156dd38
      Juanma Barranquero authored
      * src/eval.c (init_eval_once): Set max_specpdl_size to 1500.
      * doc/lispref/variables.texi (Local Variables): Document it.
      4156dd38
    • Alan Third's avatar
      Revert "Simplify image transforms" · beb572a7
      Alan Third authored
      This reverts commit cf3081d2.
      
      ; Pushed in error.
      beb572a7
    • Alan Third's avatar
      Simplify image transforms · cf3081d2
      Alan Third authored
      * src/image.c: (image_set_rotation, image_set_size,
      image_set_transform): Combine into image_set_transform.
      (image_set_crop): Remove function.
      (lookup_image): Remove calls to removed functions and remove
      transform_matrix.
      * test/manual/image-transforms-tests.el (test-cropping): Remove
      function.
      (test-transforms): Remove reference to test-cropping.
      cf3081d2
    • Alan Third's avatar
      Document image transforms · 11b0e334
      Alan Third authored
      * doc/lispref/display.texi (Image Descriptors): Document :crop and
      update :rotation.
      * src/image.c: Describe the image transform matrix layout.
      * test/manual/image-transforms-tests.el: New file.
      11b0e334
  4. 15 Jun, 2019 9 commits
  5. 13 Jun, 2019 1 commit
  6. 11 Jun, 2019 1 commit
  7. 10 Jun, 2019 5 commits
  8. 09 Jun, 2019 4 commits
    • Paul Eggert's avatar
      * src/fns.c (cmpfn_eql): Simplify. · 179b9c44
      Paul Eggert authored
      179b9c44
    • Paul Eggert's avatar
      Fix int overflow bug in ‘equal’ · 1e6396ec
      Paul Eggert authored
      * src/fns.c (internal_equal):
      Fix bug when vector lengths exceed INT_MAX.
      1e6396ec
    • Paul Eggert's avatar
      Tune base64 decoding · 5abaea33
      Paul Eggert authored
      This improves performance of base64-decode-region by about 7.5% on
      my platform, and gets rid of some macros.
      * src/fns.c (IS_ASCII, IS_BASE64, IS_BASE64_IGNORABLE)
      (READ_QUADRUPLET_BYTE): Remove.
      (base64_value_to_char, base64_char_to_value):
      Now an array of two arrays.  All uses changed.
      (base64url_value_to_char, base64url_char_to_value):
      Remove.  All uses changed to the other array.
      (base64_char_to_value): Entries are now of type signed char, not
      short, since we can assume C99.  Use C99 initializers; this is
      clearer and caters to the (theoretical) possibility of systems
      that do not use ASCII or do not have 8-bit bytes.  Allow any index
      in the range 0..UCHAR_MAX instead of limiting it to 0..127, so
      that uses need not check for in-range indexes.  Also record
      padding chars.  All uses changed.
      (base64_decode_1): Always store number of chars in *NCHARS_RETURN,
      for simplicity.  All callers changed.  Speed up the byte-fetching.
      5abaea33
    • Stefan Kangas's avatar
  9. 08 Jun, 2019 4 commits
    • Eli Zaretskii's avatar
      Minor fixes for the last commits · 1cc90d21
      Eli Zaretskii authored
      * src/fns.c (Fbase64url_encode_region)
      (Fbase64url_encode_string, Fbase64_decode_region)
      (Fbase64_decode_string): Fix doc strings.
      (base64_decode_1): Minor stylistic code changes.
      
      * doc/lispref/text.texi (Base 64): Fix typos and improve
      wording of the last committed text.
      1cc90d21
    • Pierre Téchoueyres's avatar
      Add support for base64url variant of base-64 encoding/decoding · 7541b068
      Pierre Téchoueyres authored
      Implement the RFC4648 variant of base64 encoding used by URLs.
      * doc/lispref/text.texi (base64url-encode-region,
      base64url-encode-string): Document new functions.
      (base64-decode-region, base64-decode-string): Document new optional
      parameter 'base64url' used to use url variant when decoding data.
      
      * src/fns.c (base64url-encode-region, base64url-encode-region): New
      functions to manage url variant.
      (base64-decode-region, base64-decode-string): Add optional
      parameter to indicate use of url-variant.
      (base64_encode_region_1, base64_encode_string_1): Internal functions
      with extracted code from 'base64_encode_region' and
      'base64_encode_string' and optional parameters to manage padding and
      url variant.
      (base64-encode-region, base64-encode-string) : Use
      base64_encode_region_1 and base64_encode_string_1.
      (base64-encode-1): Add parameters to manage padding and url variant.
      (base64-decode-1): Add parameter to manage url variant.
      
      * test/src/fns-tests.el (fns-tests--with-region): New helper macro to
      test region variant of base64 encode / decode functions.
      (fns-tests--string-repeat): Helper function used in base64 tests.
      (fns-tests-base64-encode-region, fns-tests-base64-encode-string):
      Tests for standard base64 function.
      (fns-test-base64url-encode-region,
      fns-test-base64url-encode-string): Tests for url variant.
      (fns-tests-base64-decode-string): Tests for decoding part.
      7541b068
    • YAMAMOTO Mitsuharu's avatar
      Support X core font driver on cairo (Bug#28236) · faf10bd8
      YAMAMOTO Mitsuharu authored
      * configure.ac (HAVE_X_WINDOWS): Add xfont.o to FONT_OBJ if HAVE_CAIRO.
      
      * doc/lispref/frames.texi (Font and Color Parameters): Mention X core font
      driver with Cairo drawing.
      
      * src/font.c (syms_of_font) [HAVE_X_WINDOWS && USE_CAIRO]: Call syms_of_xfont.
      
      * src/xfns.c (x_create_tip_frame) [USE_CAIRO]: Register xfont_driver.
      
      * src/xterm.c (x_cr_gc_clip) [USE_CAIRO]: New function extracted from
      x_begin_cr_clip.
      (x_begin_cr_clip) [USE_CAIRO]: Use it.
      (xlib_surface_key, saved_drawable_key) [USE_CAIRO]: New variables.
      (x_cr_destroy_xlib_surface, x_try_cr_xlib_drawable)
      (x_end_cr_xlib_drawable) [USE_CAIRO]: New functions.
      (x_draw_composite_glyph_string_foreground)
      (x_draw_glyph_string_foreground) [USE_CAIRO]: Get Xlib surface when drawing
      text with X core fonts into bitmap surfaces.  Add fallback code for drawing
      into outline surfaces.
      faf10bd8
    • YAMAMOTO Mitsuharu's avatar
      Implement native image rotation and cropping on cairo · 88c49ac3
      YAMAMOTO Mitsuharu authored
      * src/dispextern.h (struct image) [USE_CAIRO]:
      * src/image.c (free_image, image_clear_image_1)
      (image_set_crop, image_set_size, image_set_rotation)
      (image_create_x_image_and_pixmap) [USE_CAIRO]: #ifdef out HAVE_XRENDER part.
      
      * src/image.c (cr_create_surface_from_pix_containers) [USE_CAIRO]: Rename
      from cr_create_surface_from_pix_containers.  Change arguments to pair of
      Emacs_Pix_Container:s.  Move block_input and unblock_input to caller.
      (cr_put_image_to_cr_data) [USE_CAIRO]: New function.
      (prepare_image_for_display) [USE_CAIRO]: Use it.
      (image_set_transform) [USE_CAIRO]: Create dummy solid color pattern equipped
      with transformation matrix and set it to img->cr_data.
      
      * src/xterm.c (fringe_bmp) [USE_CAIRO]: Change type to cairo_pattern_t **.
      (x_cr_define_fringe_bitmap, x_cr_destroy_fringe_bitmap) [USE_CAIRO]: Create
      or destroy cairo pattern.
      (x_cr_draw_image) [USE_CAIRO]: Remove arguments image_width and image_height.
      Change type of image to cairo pattern.  All callers changed.
      
      * src/gtkutil.c (xg_get_image_for_pixmap) [USE_CAIRO]: Get cairo surface
      from img->cr_data, which is of cairo pattern now.
      88c49ac3
  10. 07 Jun, 2019 7 commits
    • Paul Eggert's avatar
      Fix commentary about fixnums and hashes. · 58cde923
      Paul Eggert authored
      58cde923
    • Paul Eggert's avatar
      Fix minor ssize_t / ptrdiff_t confusion · 8553af84
      Paul Eggert authored
      * src/fileio.c (Fcopy_file): This limit is because of ssize_t,
      so use TYPE_MAXIMUM (ssize_t) not PTRDIFF_MAX.
      8553af84
    • Paul Eggert's avatar
      Use machine pointer width for face hashes · de46a6a4
      Paul Eggert authored
      * src/dispextern.h (struct face):
      * src/xfaces.c (hash_string_case_insensitive, lface_hash)
      (cache_face, lookup_face): Use uintptr_t for face hashes
      instead of discarding the upper pointer bits on 64-bit machines.
      de46a6a4
    • Eli Zaretskii's avatar
      aecbbd57
    • YAMAMOTO Mitsuharu's avatar
      Fix image_set_crop yet again · 3a1f92d0
      YAMAMOTO Mitsuharu authored
      * src/image.c (image_set_crop) [HAVE_NATIVE_TRANSFORMS]: Don't call
      compute_image_size, as it is already called from image_set_size.
      (image_set_size, image_set_crop) [HAVE_NATIVE_TRANSFORMS]: Use harmless
      matrix transformation code also for USE_CAIRO and HAVE_NTGUI cases,
      though image_set_transform is not yet implemented on them.
      3a1f92d0
    • Paul Eggert's avatar
      Fix recently-introduced image_set_crop typo · cfb592fd
      Paul Eggert authored
      * src/image.c (image_set_crop) [!HAVE_NATIVE_TRANSFORMS]:
      Don’t call compute_image_size, as it does not exist and its
      result is not needed.
      cfb592fd
    • Paul Eggert's avatar
      Use copy_file_range to copy files · 486a81f3
      Paul Eggert authored
      The copy_file_range syscall (introduced in Linux kernel
      version 4.5) can copy files more efficiently via server-side
      copy etc.
      * admin/merge-gnulib (GNULIB_MODULES): Add copy-file-range.
      * lib/copy-file-range.c, m4/copy-file-range.m4:
      New files, copied from Gnulib.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * src/fileio.c (Fcopy_file): Try copy_file_range first,
      falling back on read+write only if copy_file_range failed or
      if the input is empty and so could be a /proc file.
      486a81f3
  11. 06 Jun, 2019 1 commit
    • Paul Eggert's avatar
      Fix overflow issues in image rotation · 7c26e0b1
      Paul Eggert authored
      Also, do some refactoring to simplify code.
      * src/dispextern.h (INIT_MATRIX, COPY_MATRIX, MULT_MATRICES): Remove.
      * src/image.c (matrix3x3): New type, replacing all uses of 3x3 double.
      (matrix3x3_copy, matrix3x3_mult): New functions, replacing
      COPY_MATRIX, MULT_MATRICES.  Replace INIT_MATRIX by C initializers.
      (image_set_rotation): Use Fmod to avoid undefined behavior on
      double-to-int conversion and to reduce bignum rotations correctly.
      (image_set_crop): Finish up previous correction, by not re-setting
      width and height if compute_image_size has set them.
      Prefer shifting right by 1 to dividing by 2 if either will do.
      7c26e0b1