diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-09 02:25:37 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-05-09 02:25:37 -0700 |
commit | 33fa63a3c5f2f2df27b68ca67cf46bf9788d8723 (patch) | |
tree | c222a87d2eadb32a50fa8c6d787eb81d5d728f75 | |
parent | c3323f3c70ab53e5fe2f9aae7ba26b1a21cd622a (diff) | |
parent | d51c61481fc2a1d18f27b898a7cdc0bdd84be40b (diff) | |
download | servo-33fa63a3c5f2f2df27b68ca67cf46bf9788d8723.tar.gz servo-33fa63a3c5f2f2df27b68ca67cf46bf9788d8723.zip |
Auto merge of #11083 - kevgs:image_metadata, r=Ms2ger
move struct ImageMetadata to a better place
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11083)
<!-- Reviewable:end -->
-rw-r--r-- | components/msg/constellation_msg.rs | 6 | ||||
-rw-r--r-- | components/net_traits/image/base.rs | 8 | ||||
-rw-r--r-- | components/net_traits/image_cache_thread.rs | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index cab09add966..08d7a5439b3 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -220,12 +220,6 @@ pub enum PixelFormat { RGBA8, // RGB + alpha, 8 bits per channel } -#[derive(Clone, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)] -pub struct ImageMetadata { - pub width: u32, - pub height: u32, -} - #[derive(Clone, Deserialize, Serialize, HeapSizeOf)] pub struct Image { pub width: u32, diff --git a/components/net_traits/image/base.rs b/components/net_traits/image/base.rs index 69d02466b1d..e2a9a3ca21e 100644 --- a/components/net_traits/image/base.rs +++ b/components/net_traits/image/base.rs @@ -6,7 +6,13 @@ use ipc_channel::ipc::IpcSharedMemory; use piston_image::{self, DynamicImage, GenericImage, ImageFormat}; use util::opts; -pub use msg::constellation_msg::{Image, ImageMetadata, PixelFormat}; +pub use msg::constellation_msg::{Image, PixelFormat}; + +#[derive(Clone, Deserialize, Eq, PartialEq, Serialize, HeapSizeOf)] +pub struct ImageMetadata { + pub width: u32, + pub height: u32, +} // FIXME: Images must not be copied every frame. Instead we should atomically // reference count them. diff --git a/components/net_traits/image_cache_thread.rs b/components/net_traits/image_cache_thread.rs index 4b17cce7309..ae0e6e7738d 100644 --- a/components/net_traits/image_cache_thread.rs +++ b/components/net_traits/image_cache_thread.rs @@ -2,8 +2,9 @@ * 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 image::base::ImageMetadata; use ipc_channel::ipc::{self, IpcSender}; -use msg::constellation_msg::{Image, ImageMetadata}; +use msg::constellation_msg::Image; use std::sync::Arc; use url::Url; |