Bug 1510221 - Update webrender to commit 195582a8dc5b9c6d26d54ce8d70060ccc8f423d8 (WR PR #3337). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Tue, 27 Nov 2018 19:19:54 +0000
changeset 504794 f1f219c67ea86f83b400cf1f55cf61f2192afe5e
parent 504793 b7c7c49fcaa8df366fcefd286c5db0a0a4b5d903
child 504795 67c8cedbfd4eeaf7ab6a85296340e1db9c5afe86
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1510221
milestone65.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 1510221 - Update webrender to commit 195582a8dc5b9c6d26d54ce8d70060ccc8f423d8 (WR PR #3337). r=kats https://github.com/servo/webrender/pull/3337 Differential Revision: https://phabricator.services.mozilla.com/D13111
gfx/webrender_bindings/revision.txt
gfx/wr/webrender/src/device/gl.rs
gfx/wr/webrender/src/texture_cache.rs
gfx/wr/webrender_api/src/image.rs
gfx/wr/wrench/src/yaml_frame_reader.rs
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-ea8f4a922b2aa38c40de137d7f0ab6598d53e29a
+195582a8dc5b9c6d26d54ce8d70060ccc8f423d8
--- a/gfx/wr/webrender/src/device/gl.rs
+++ b/gfx/wr/webrender/src/device/gl.rs
@@ -2622,16 +2622,23 @@ impl Device {
             },
             ImageFormat::BGRA8 => {
                 FormatDesc {
                     internal: self.bgra_format_internal,
                     external: self.bgra_format_external,
                     pixel_type: gl::UNSIGNED_BYTE,
                 }
             },
+            ImageFormat::RGBA8 => {
+                FormatDesc {
+                    internal: gl::RGBA8,
+                    external: gl::RGBA,
+                    pixel_type: gl::UNSIGNED_BYTE,
+                }
+            },
             ImageFormat::RGBAF32 => FormatDesc {
                 internal: gl::RGBA32F,
                 external: gl::RGBA,
                 pixel_type: gl::FLOAT,
             },
             ImageFormat::RGBAI32 => FormatDesc {
                 internal: gl::RGBA32I,
                 external: gl::RGBA_INTEGER,
@@ -2778,16 +2785,17 @@ impl<'a, T> TextureUploader<'a, T> {
 }
 
 impl<'a> UploadTarget<'a> {
     fn update_impl(&mut self, chunk: UploadChunk) {
         let (gl_format, bpp, data_type) = match self.texture.format {
             ImageFormat::R8 => (gl::RED, 1, gl::UNSIGNED_BYTE),
             ImageFormat::R16 => (gl::RED, 2, gl::UNSIGNED_SHORT),
             ImageFormat::BGRA8 => (self.bgra_format, 4, gl::UNSIGNED_BYTE),
+            ImageFormat::RGBA8 => (gl::RGBA, 4, gl::UNSIGNED_BYTE),
             ImageFormat::RG8 => (gl::RG, 2, gl::UNSIGNED_BYTE),
             ImageFormat::RGBAF32 => (gl::RGBA, 16, gl::FLOAT),
             ImageFormat::RGBAI32 => (gl::RGBA_INTEGER, 16, gl::INT),
         };
 
         let row_length = match chunk.stride {
             Some(value) => value / bpp,
             None => self.texture.size.width,
--- a/gfx/wr/webrender/src/texture_cache.rs
+++ b/gfx/wr/webrender/src/texture_cache.rs
@@ -948,16 +948,22 @@ impl TextureCache {
     // placed in the shared texture cache.
     pub fn is_allowed_in_shared_cache(
         &self,
         filter: TextureFilter,
         descriptor: &ImageDescriptor,
     ) -> bool {
         let mut allowed_in_shared_cache = true;
 
+        // TODO(sotaro): For now, anything that requests RGBA8 just fails to allocate
+        // in a texture page, and gets a standalone texture.
+        if descriptor.format == ImageFormat::RGBA8 {
+            allowed_in_shared_cache = false;
+        }
+
         // TODO(gw): For now, anything that requests nearest filtering and isn't BGRA8
         //           just fails to allocate in a texture page, and gets a standalone
         //           texture. This is probably rare enough that it can be fixed up later.
         if filter == TextureFilter::Nearest &&
            descriptor.format != ImageFormat::BGRA8 {
             allowed_in_shared_cache = false;
         }
 
--- a/gfx/wr/webrender_api/src/image.rs
+++ b/gfx/wr/webrender_api/src/image.rs
@@ -111,28 +111,31 @@ pub enum ImageFormat {
     BGRA8 = 3,
     /// Four channels, float storage.
     RGBAF32 = 4,
     /// Two-channels, byte storage. Similar to `R8`, this just means
     /// "two channels" rather than "red and green".
     RG8 = 5,
     /// Four channels, signed integer storage.
     RGBAI32 = 6,
+    /// Four channels, byte storage.
+    RGBA8 = 7,
 }
 
 impl ImageFormat {
     /// Returns the number of bytes per pixel for the given format.
     pub fn bytes_per_pixel(self) -> i32 {
         match self {
             ImageFormat::R8 => 1,
             ImageFormat::R16 => 2,
             ImageFormat::BGRA8 => 4,
             ImageFormat::RGBAF32 => 16,
             ImageFormat::RG8 => 2,
             ImageFormat::RGBAI32 => 16,
+            ImageFormat::RGBA8 => 4,
         }
     }
 }
 
 /// Specifies the color depth of an image. Currently only used for YUV images.
 #[repr(u8)]
 #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
 pub enum ColorDepth {
--- a/gfx/wr/wrench/src/yaml_frame_reader.rs
+++ b/gfx/wr/wrench/src/yaml_frame_reader.rs
@@ -173,17 +173,18 @@ fn generate_solid_color_image(
         ImageData::new(pixels),
     )
 }
 
 
 
 fn is_image_opaque(format: ImageFormat, bytes: &[u8]) -> bool {
     match format {
-        ImageFormat::BGRA8 => {
+        ImageFormat::BGRA8 |
+        ImageFormat::RGBA8 => {
             let mut is_opaque = true;
             for i in 0 .. (bytes.len() / 4) {
                 if bytes[i * 4 + 3] != 255 {
                     is_opaque = false;
                     break;
                 }
             }
             is_opaque