Bug 1116473 - [3.2] Use RefPtr for AndroidSurfaceTexture references. r=snorp, a=lizzard
authorEugen Sawin <esawin@mozilla.com>
Tue, 23 Feb 2016 20:40:20 +0100
changeset 304266 0730dd8d4cb6b14b6ce7eddb251392c1f1b3374d
parent 304265 92fe1f06f19153082609121b80dcb6e1a1e9b5ba
child 304267 6852f8afb9ea84e39ea7e8760b3cb587ac8cfbe4
push id9148
push usercbook@mozilla.com
push dateMon, 29 Feb 2016 08:27:20 +0000
treeherdermozilla-aurora@10e1774de80e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, lizzard
bugs1116473
milestone46.0a2
Bug 1116473 - [3.2] Use RefPtr for AndroidSurfaceTexture references. r=snorp, a=lizzard
gfx/layers/GLImages.h
gfx/layers/opengl/TextureHostOGL.h
--- a/gfx/layers/GLImages.h
+++ b/gfx/layers/GLImages.h
@@ -1,27 +1,25 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
 #ifndef GFX_GLIMAGES_H
 #define GFX_GLIMAGES_H
 
+#include "AndroidSurfaceTexture.h"
 #include "GLContextTypes.h"
 #include "GLTypes.h"
 #include "ImageContainer.h"             // for Image
 #include "ImageTypes.h"                 // for ImageFormat::SHARED_GLTEXTURE
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "mozilla/gfx/Point.h"          // for IntSize
 
 namespace mozilla {
-namespace gl {
-class AndroidSurfaceTexture;
-} // namespace gl
 namespace layers {
 
 class GLImage : public Image {
 public:
   explicit GLImage(ImageFormat aFormat) : Image(nullptr, aFormat){}
 
   virtual already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() override;
 };
@@ -74,17 +72,17 @@ public:
     return mOriginPos;
   }
 
   SurfaceTextureImage* AsSurfaceTextureImage() override {
     return this;
   }
 
 private:
-  gl::AndroidSurfaceTexture* mSurfaceTexture;
+  RefPtr<gl::AndroidSurfaceTexture> mSurfaceTexture;
   gfx::IntSize mSize;
   gl::OriginPos mOriginPos;
 };
 
 #endif // MOZ_WIDGET_ANDROID
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/opengl/TextureHostOGL.h
+++ b/gfx/layers/opengl/TextureHostOGL.h
@@ -364,17 +364,17 @@ public:
   virtual void DeallocateDeviceData() override {}
 
   virtual void SetCompositor(Compositor* aCompositor) override;
 
   gl::GLContext* gl() const;
 
 protected:
   RefPtr<CompositorOGL> mCompositor;
-  mozilla::gl::AndroidSurfaceTexture* const mSurfTex;
+  RefPtr<gl::AndroidSurfaceTexture> const mSurfTex;
   const gfx::SurfaceFormat mFormat;
   const GLenum mTextureTarget;
   const GLenum mWrapMode;
   const gfx::IntSize mSize;
 };
 
 class SurfaceTextureHost : public TextureHost
 {
@@ -409,17 +409,17 @@ public:
 
   gl::GLContext* gl() const;
 
   virtual gfx::IntSize GetSize() const override { return mSize; }
 
   virtual const char* Name() { return "SurfaceTextureHost"; }
 
 protected:
-  mozilla::gl::AndroidSurfaceTexture* const mSurfTex;
+  RefPtr<gl::AndroidSurfaceTexture> const mSurfTex;
   const gfx::IntSize mSize;
   RefPtr<CompositorOGL> mCompositor;
   RefPtr<SurfaceTextureSource> mTextureSource;
 };
 
 #endif // MOZ_WIDGET_ANDROID
 
 ////////////////////////////////////////////////////////////////////////