Bug 1525402 - Manual fixups for configs cargo fix missed. r=kvark
authorAlexis Beingessner <a.beingessner@gmail.com>
Tue, 07 May 2019 01:40:21 +0000
changeset 531637 16d8a19df81393398075c6f4695d9a55b96b55d2
parent 531636 8c7d885ae03623bf540a6d31372b5585e2aabcab
child 531638 f072f15ba54ede2c3c1eb24c09593284b3bc7c72
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark
bugs1525402
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1525402 - Manual fixups for configs cargo fix missed. r=kvark cargo fix works by building under a specific config, so we can't hit both sides of a mutually exclusive pair of cfgs, such as cfg(target_os) or when cfg(feature) and cfg(not(feature)) both exist in the codebase. Differential Revision: https://phabricator.services.mozilla.com/D29568
gfx/wr/webrender/src/glyph_cache.rs
gfx/wr/webrender/src/glyph_rasterizer/pathfinder.rs
gfx/wr/webrender/src/gpu_glyph_renderer.rs
gfx/wr/webrender/src/lib.rs
gfx/wr/webrender/src/platform/macos/font.rs
gfx/wr/webrender/src/platform/unix/font.rs
gfx/wr/webrender/src/platform/windows/font.rs
gfx/wr/webrender/src/renderer.rs
gfx/wr/wrench/src/angle.rs
--- a/gfx/wr/webrender/src/glyph_cache.rs
+++ b/gfx/wr/webrender/src/glyph_cache.rs
@@ -1,24 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #[cfg(feature = "pathfinder")]
-use api::units::DeviceIntPoint;
-use glyph_rasterizer::{FontInstance, GlyphFormat, GlyphKey, GlyphRasterizer};
-use internal_types::FastHashMap;
-use render_task::RenderTaskCache;
+use crate::api::units::DeviceIntPoint;
+use crate::glyph_rasterizer::{FontInstance, GlyphFormat, GlyphKey, GlyphRasterizer};
+use crate::internal_types::FastHashMap;
+use crate::render_task::RenderTaskCache;
 #[cfg(feature = "pathfinder")]
-use render_task::RenderTaskCacheKey;
-use resource_cache::ResourceClassCache;
+use crate::render_task::RenderTaskCacheKey;
+use crate::resource_cache::ResourceClassCache;
 use std::sync::Arc;
-use texture_cache::{EvictionNotice, TextureCache};
+use crate::texture_cache::{EvictionNotice, TextureCache};
 #[cfg(not(feature = "pathfinder"))]
-use texture_cache::TextureCacheHandle;
+use crate::texture_cache::TextureCacheHandle;
 
 #[cfg_attr(feature = "capture", derive(Serialize))]
 #[cfg_attr(feature = "replay", derive(Deserialize))]
 #[derive(Clone, Debug)]
 pub struct CachedGlyphInfo {
     pub format: GlyphFormat,
     #[cfg(not(feature = "pathfinder"))]
     pub texture_cache_handle: TextureCacheHandle,
--- a/gfx/wr/webrender/src/glyph_rasterizer/pathfinder.rs
+++ b/gfx/wr/webrender/src/glyph_rasterizer/pathfinder.rs
@@ -5,30 +5,31 @@
 //! Module only available when pathfinder is activated
 
 use api::{FontKey, FontTemplate, NativeFontHandle};
 use api::units::{DeviceIntPoint, DeviceIntSize, DevicePixel};
 use euclid::{TypedPoint2D, TypedSize2D, TypedVector2D};
 use pathfinder_font_renderer;
 use pathfinder_partitioner::mesh::Mesh as PathfinderMesh;
 use pathfinder_path_utils::cubic_to_quadratic::CubicToQuadraticTransformer;
-use render_task::{RenderTask, RenderTaskTree, RenderTaskCache, RenderTaskCacheKey, RenderTaskCacheEntryHandle,
-                  RenderTaskCacheKeyKind, RenderTaskId, RenderTaskLocation};
-use resource_cache::CacheItem;
+use crate::render_task::{RenderTask, RenderTaskTree, RenderTaskCache, RenderTaskCacheKey,
+                         RenderTaskCacheEntryHandle, RenderTaskCacheKeyKind, RenderTaskId,
+                         RenderTaskLocation};
+use crate::resource_cache::CacheItem;
 use std::ops::Deref;
 use std::sync::{Arc, Mutex, MutexGuard};
-use glyph_rasterizer::AddFont;
-use internal_types::ResourceCacheError;
-use glyph_cache::{GlyphCache, GlyphCacheEntry, CachedGlyphInfo};
+use crate::glyph_rasterizer::AddFont;
+use crate::internal_types::ResourceCacheError;
+use crate::glyph_cache::{GlyphCache, GlyphCacheEntry, CachedGlyphInfo};
 use std::collections::hash_map::Entry;
 use std::f32;
-use glyph_rasterizer::{FontInstance, GlyphRasterizer, GlyphFormat, GlyphKey, FontContexts};
-use texture_cache::TextureCache;
-use gpu_cache::GpuCache;
-use profiler::TextureCacheProfileCounters;
+use crate::glyph_rasterizer::{FontInstance, GlyphRasterizer, GlyphFormat, GlyphKey, FontContexts};
+use crate::texture_cache::TextureCache;
+use crate::gpu_cache::GpuCache;
+use crate::profiler::TextureCacheProfileCounters;
 
 /// Should match macOS 10.13 High Sierra.
 ///
 /// We multiply by sqrt(2) to compensate for the fact that dilation amounts are relative to the
 /// pixel square on macOS and relative to the vertex normal in Pathfinder.
 const STEM_DARKENING_FACTOR_X: f32 = 0.0121 * f32::consts::SQRT_2;
 const STEM_DARKENING_FACTOR_Y: f32 = 0.0121 * 1.25 * f32::consts::SQRT_2;
 
@@ -164,30 +165,30 @@ impl GlyphRasterizer {
 
         let (x_scale, y_scale) = font.transform.compute_scale().unwrap_or((1.0, 1.0));
         let scale = font.oversized_scale_factor(x_scale, y_scale) as f32;
 
         // select glyphs that have not been requested yet.
         for glyph_key in glyph_keys {
             let mut cached_glyph_info = None;
             match glyph_key_cache.entry(glyph_key.clone()) {
-                Entry::Occupied(mut entry) => {
+                Entry::Occupied(entry) => {
                     let value = entry.into_mut();
                     match *value {
                         GlyphCacheEntry::Cached(ref glyph_info) => {
                             cached_glyph_info = Some(glyph_info.clone())
                         }
                         GlyphCacheEntry::Blank | GlyphCacheEntry::Pending => {}
                     }
                 }
                 Entry::Vacant(_) => {}
             }
 
             if cached_glyph_info.is_none() {
-                let mut pathfinder_font_context = self.font_contexts.lock_pathfinder_context();
+                let pathfinder_font_context = self.font_contexts.lock_pathfinder_context();
 
                 let pathfinder_font_instance = pathfinder_font_renderer::FontInstance {
                     font_key: font.font_key.clone(),
                     size: font.size.scale_by(scale.recip()),
                 };
 
                 // TODO: pathfinder will need to support 2D subpixel offset
                 let pathfinder_subpixel_offset =
@@ -280,18 +281,18 @@ fn request_render_task_from_pathfinder(
     let pathfinder_subpixel_offset =
         pathfinder_font_renderer::SubpixelOffset(glyph_key.subpixel_offset().0 as u8);
     let glyph_subpixel_offset: f64 = glyph_key.subpixel_offset().0.into();
     let pathfinder_glyph_key = pathfinder_font_renderer::GlyphKey::new(glyph_key.index(),
                                                                        pathfinder_subpixel_offset);
 
     // TODO(pcwalton): Fall back to CPU rendering if Pathfinder fails to collect the outline.
     let mut mesh = PathfinderMesh::new();
-    let outline = try!(font_context.glyph_outline(&pathfinder_font_instance,
-                                                  &pathfinder_glyph_key));
+    let outline = font_context.glyph_outline(&pathfinder_font_instance,
+                                             &pathfinder_glyph_key)?;
     let tolerance = CUBIC_TO_QUADRATIC_APPROX_TOLERANCE;
     mesh.push_stencil_segments(CubicToQuadraticTransformer::new(outline.iter(), tolerance));
     mesh.push_stencil_normals(CubicToQuadraticTransformer::new(outline.iter(), tolerance));
 
     // FIXME(pcwalton): Support vertical subpixel offsets.
     // FIXME(pcwalton): Embolden amount should be 0 on macOS if "Use LCD font
     // smoothing" is unchecked in System Preferences.
 
--- a/gfx/wr/webrender/src/gpu_glyph_renderer.rs
+++ b/gfx/wr/webrender/src/gpu_glyph_renderer.rs
@@ -1,26 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! GPU glyph rasterization using Pathfinder.
 
-use api::{ImageFormat, FontRenderMode, TextureTarget};
-use api::units::*;
-use debug_colors;
-use device::{DrawTarget, Device, Texture, TextureFilter, VAO};
+use crate::api::{ImageFormat, FontRenderMode, TextureTarget};
+use crate::api::units::*;
+use crate::debug_colors;
+use crate::device::{DrawTarget, Device, Texture, TextureFilter, VAO};
 use euclid::{Point2D, Size2D, Transform3D, TypedVector2D, Vector2D};
-use internal_types::RenderTargetInfo;
+use crate::internal_types::RenderTargetInfo;
 use pathfinder_gfx_utils::ShelfBinPacker;
-use profiler::GpuProfileTag;
-use renderer::{self, ImageBufferKind, Renderer, RendererError, RendererStats};
-use renderer::{TextureSampler, VertexArrayKind, ShaderPrecacheFlags};
-use shade::{LazilyCompiledShader, ShaderKind};
-use tiling::GlyphJob;
+use crate::profiler::GpuProfileTag;
+use crate::renderer::{self, ImageBufferKind, Renderer, RendererError, RendererStats};
+use crate::renderer::{TextureSampler, VertexArrayKind, ShaderPrecacheFlags};
+use crate::shade::{LazilyCompiledShader, ShaderKind};
+use crate::tiling::GlyphJob;
 
 // The area lookup table in uncompressed grayscale TGA format (TGA image format 3).
 static AREA_LUT_TGA_BYTES: &'static [u8] = include_bytes!("../res/area-lut.tga");
 
 const HORIZONTAL_BIN_PADDING: i32 = 3;
 
 const GPU_TAG_GLYPH_STENCIL: GpuProfileTag = GpuProfileTag {
     label: "Glyph Stencil",
@@ -66,31 +66,28 @@ impl GpuGlyphRenderer {
         device.upload_texture_immediate(&area_lut_texture, area_lut_pixels);
 
         let vector_stencil_vao =
             device.create_vao_with_new_instances(&renderer::desc::VECTOR_STENCIL, prim_vao);
         let vector_cover_vao = device.create_vao_with_new_instances(&renderer::desc::VECTOR_COVER,
                                                                     prim_vao);
 
         // Load Pathfinder vector graphics shaders.
-        let vector_stencil = try!{
+        let vector_stencil =
             LazilyCompiledShader::new(ShaderKind::VectorStencil,
                                       "pf_vector_stencil",
                                       &[ImageBufferKind::Texture2D.get_feature_string()],
                                       device,
-                                      precache_flags)
-        };
-        let vector_cover = try!{
+                                      precache_flags)?;
+        let vector_cover =
             LazilyCompiledShader::new(ShaderKind::VectorCover,
                                       "pf_vector_cover",
                                       &[ImageBufferKind::Texture2D.get_feature_string()],
                                       device,
-                                      precache_flags)
-        };
-
+                                      precache_flags)?;
         Ok(GpuGlyphRenderer {
             area_lut_texture,
             vector_stencil_vao,
             vector_cover_vao,
             vector_stencil,
             vector_cover,
         })
     }
--- a/gfx/wr/webrender/src/lib.rs
+++ b/gfx/wr/webrender/src/lib.rs
@@ -129,19 +129,19 @@ mod shader_source {
 }
 
 pub use record::{ApiRecordingReceiver, BinaryRecorder, WEBRENDER_RECORDING_HEADER};
 
 mod platform {
     #[cfg(target_os = "macos")]
     pub use platform::macos::font;
     #[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))]
-    pub use platform::unix::font;
+    pub use crate::platform::unix::font;
     #[cfg(target_os = "windows")]
-    pub use platform::windows::font;
+    pub use crate::platform::windows::font;
 
     #[cfg(target_os = "macos")]
     pub mod macos {
         pub mod font;
     }
     #[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))]
     pub mod unix {
         pub mod font;
--- a/gfx/wr/webrender/src/platform/macos/font.rs
+++ b/gfx/wr/webrender/src/platform/macos/font.rs
@@ -23,17 +23,17 @@ use core_graphics::geometry::{CGAffineTr
 use core_graphics::geometry::{CG_AFFINE_TRANSFORM_IDENTITY, CGRect};
 use core_text;
 use core_text::font::{CTFont, CTFontRef};
 use core_text::font_descriptor::{kCTFontDefaultOrientation, kCTFontColorGlyphsTrait};
 use euclid::Size2D;
 use gamma_lut::{ColorLut, GammaLut};
 use glyph_rasterizer::{FontInstance, FontTransform, GlyphKey};
 #[cfg(feature = "pathfinder")]
-use glyph_rasterizer::NativeFontHandleWrapper;
+use crate::glyph_rasterizer::NativeFontHandleWrapper;
 #[cfg(not(feature = "pathfinder"))]
 use glyph_rasterizer::{GlyphFormat, GlyphRasterError, GlyphRasterResult, RasterizedGlyph};
 use internal_types::{FastHashMap, ResourceCacheError};
 use std::collections::hash_map::Entry;
 use std::sync::Arc;
 
 const INITIAL_CG_CONTEXT_SIDE_LENGTH: u32 = 32;
 
--- a/gfx/wr/webrender/src/platform/unix/font.rs
+++ b/gfx/wr/webrender/src/platform/unix/font.rs
@@ -15,21 +15,21 @@ use freetype::freetype::{FT_Library, FT_
 use freetype::freetype::{FT_Fixed, FT_Matrix, FT_Set_Transform, FT_String, FT_ULong};
 use freetype::freetype::{FT_Err_Unimplemented_Feature};
 use freetype::freetype::{FT_LOAD_COLOR, FT_LOAD_DEFAULT, FT_LOAD_FORCE_AUTOHINT};
 use freetype::freetype::{FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH, FT_LOAD_NO_AUTOHINT};
 use freetype::freetype::{FT_LOAD_NO_BITMAP, FT_LOAD_NO_HINTING, FT_LOAD_VERTICAL_LAYOUT};
 use freetype::freetype::{FT_FACE_FLAG_SCALABLE, FT_FACE_FLAG_FIXED_SIZES};
 use freetype::freetype::{FT_FACE_FLAG_MULTIPLE_MASTERS};
 use freetype::succeeded;
-use glyph_rasterizer::{FontInstance, GlyphFormat, GlyphKey};
-use glyph_rasterizer::{GlyphRasterError, GlyphRasterResult, RasterizedGlyph};
+use crate::glyph_rasterizer::{FontInstance, GlyphFormat, GlyphKey};
+use crate::glyph_rasterizer::{GlyphRasterError, GlyphRasterResult, RasterizedGlyph};
 #[cfg(feature = "pathfinder")]
-use glyph_rasterizer::NativeFontHandleWrapper;
-use internal_types::{FastHashMap, ResourceCacheError};
+use crate::glyph_rasterizer::NativeFontHandleWrapper;
+use crate::internal_types::{FastHashMap, ResourceCacheError};
 #[cfg(any(not(target_os = "android"), feature = "no_static_freetype"))]
 use libc::{dlsym, RTLD_DEFAULT};
 use libc::free;
 #[cfg(feature = "pathfinder")]
 use pathfinder_font_renderer::freetype as pf_freetype;
 use std::{cmp, mem, ptr, slice};
 use std::cmp::max;
 use std::collections::hash_map::Entry;
--- a/gfx/wr/webrender/src/platform/windows/font.rs
+++ b/gfx/wr/webrender/src/platform/windows/font.rs
@@ -1,32 +1,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{FontInstanceFlags, FontKey, FontRenderMode, FontVariation};
 use api::{ColorU, GlyphDimensions, NativeFontHandle};
 use dwrote;
-use gamma_lut::ColorLut;
-use glyph_rasterizer::{FontInstance, FontTransform, GlyphKey};
-use internal_types::{FastHashMap, FastHashSet, ResourceCacheError};
+use crate::gamma_lut::ColorLut;
+use crate::glyph_rasterizer::{FontInstance, FontTransform, GlyphKey};
+use crate::internal_types::{FastHashMap, FastHashSet, ResourceCacheError};
 use std::borrow::Borrow;
 use std::collections::hash_map::Entry;
 use std::hash::{Hash, Hasher};
 use std::path::Path;
 use std::sync::{Arc, Mutex};
 
 cfg_if! {
     if #[cfg(feature = "pathfinder")] {
         use pathfinder_font_renderer::{PathfinderComPtr, IDWriteFontFace};
-        use glyph_rasterizer::NativeFontHandleWrapper;
+        use crate::glyph_rasterizer::NativeFontHandleWrapper;
     } else if #[cfg(not(feature = "pathfinder"))] {
         use api::FontInstancePlatformOptions;
-        use glyph_rasterizer::{GlyphFormat, GlyphRasterError, GlyphRasterResult, RasterizedGlyph};
-        use gamma_lut::GammaLut;
+        use crate::glyph_rasterizer::{GlyphFormat, GlyphRasterError, GlyphRasterResult, RasterizedGlyph};
+        use crate::gamma_lut::GammaLut;
     }
 }
 
 lazy_static! {
     static ref DEFAULT_FONT_DESCRIPTOR: dwrote::FontDescriptor = dwrote::FontDescriptor {
         family_name: "Arial".to_owned(),
         weight: dwrote::FontWeight::Regular,
         stretch: dwrote::FontStretch::Normal,
--- a/gfx/wr/webrender/src/renderer.rs
+++ b/gfx/wr/webrender/src/renderer.rs
@@ -58,22 +58,22 @@ use device::query::GpuTimer;
 use euclid::rect;
 use euclid::{Transform3D, TypedScale};
 use frame_builder::{ChasePrimitive, FrameBuilderConfig};
 use gleam::gl;
 use glyph_rasterizer::{GlyphFormat, GlyphRasterizer};
 use gpu_cache::{GpuBlockData, GpuCacheUpdate, GpuCacheUpdateList};
 use gpu_cache::{GpuCacheDebugChunk, GpuCacheDebugCmd};
 #[cfg(feature = "pathfinder")]
-use gpu_glyph_renderer::GpuGlyphRenderer;
-use gpu_types::{PrimitiveHeaderI, PrimitiveHeaderF, ScalingInstance, TransformData, ResolveInstanceData};
-use internal_types::{TextureSource, ORTHO_FAR_PLANE, ORTHO_NEAR_PLANE, ResourceCacheError};
-use internal_types::{CacheTextureId, DebugOutput, FastHashMap, FastHashSet, LayerIndex, RenderedDocument, ResultMsg};
-use internal_types::{TextureCacheAllocationKind, TextureCacheUpdate, TextureUpdateList, TextureUpdateSource};
-use internal_types::{RenderTargetInfo, SavedTargetIndex};
+use crate::gpu_glyph_renderer::GpuGlyphRenderer;
+use crate::gpu_types::{PrimitiveHeaderI, PrimitiveHeaderF, ScalingInstance, TransformData, ResolveInstanceData};
+use crate::internal_types::{TextureSource, ORTHO_FAR_PLANE, ORTHO_NEAR_PLANE, ResourceCacheError};
+use crate::internal_types::{CacheTextureId, DebugOutput, FastHashMap, FastHashSet, LayerIndex, RenderedDocument, ResultMsg};
+use crate::internal_types::{TextureCacheAllocationKind, TextureCacheUpdate, TextureUpdateList, TextureUpdateSource};
+use crate::internal_types::{RenderTargetInfo, SavedTargetIndex};
 use malloc_size_of::MallocSizeOfOps;
 use picture::{RecordedDirtyRegion, TileCache};
 use prim_store::DeferredResolve;
 use profiler::{BackendProfileCounters, FrameProfileCounters, TimeProfileCounter,
                GpuProfileTag, RendererProfileCounters, RendererProfileTimers};
 use profiler::{Profiler, ChangeIndicator};
 use device::query::{GpuProfiler, GpuDebugMethod};
 use rayon::{ThreadPool, ThreadPoolBuilder};
--- a/gfx/wr/wrench/src/angle.rs
+++ b/gfx/wr/wrench/src/angle.rs
@@ -6,17 +6,17 @@ use glutin::{self, ContextBuilder, Creat
 #[cfg(not(windows))]
 use winit::dpi::PhysicalSize;
 use winit::{EventsLoop, Window, WindowBuilder};
 
 #[cfg(not(windows))]
 pub enum Context {}
 
 #[cfg(windows)]
-pub use ::egl::Context;
+pub use crate::egl::Context;
 
 impl Context {
     #[cfg(not(windows))]
     pub fn with_window(
         _: WindowBuilder,
         _: ContextBuilder,
         _: &EventsLoop,
     ) -> Result<(Window, Self), CreationError> {