Bug 910928 - Fix build and class function override for new gralloc textures. r=nical
authorSotaro Ikeda <sotaro.ikeda.g@gmail.com>
Fri, 30 Aug 2013 10:24:05 -0400
changeset 153026 9b9eaadef7524a658d40ab251080e5ea9b30cb72
parent 153025 a0166553ef67319c9ce005db5c4fe8dfe920b095
child 153027 d683bf3bf43bd9153e73087075da2172c73b6998
child 153074 e70538986f56ab994cf5ee919a641462310587f2
push idunknown
push userunknown
push dateunknown
reviewersnical
bugs910928
milestone26.0a1
Bug 910928 - Fix build and class function override for new gralloc textures. r=nical
gfx/layers/opengl/GrallocTextureClient.cpp
gfx/layers/opengl/GrallocTextureClient.h
gfx/layers/opengl/GrallocTextureHost.cpp
gfx/layers/opengl/GrallocTextureHost.h
--- a/gfx/layers/opengl/GrallocTextureClient.cpp
+++ b/gfx/layers/opengl/GrallocTextureClient.cpp
@@ -123,17 +123,17 @@ GrallocTextureClientOGL::AllocateForSurf
     NS_WARNING("Unsupported surface format");
     return false;
   }
 
   return AllocateGralloc(aSize, format, usage);
 }
 
 bool
-GrallocTextureClientOGL::AllocateForYCbCr(gfx::IntSize aYSize, gfx::IntSize aCbCrSize)
+GrallocTextureClientOGL::AllocateForYCbCr(gfx::IntSize aYSize, gfx::IntSize aCbCrSize, StereoMode aStereoMode)
 {
   return AllocateGralloc(aYSize,
                          HAL_PIXEL_FORMAT_YV12,
                          android::GraphicBuffer::USAGE_SW_READ_OFTEN);
 }
 
 bool
 GrallocTextureClientOGL::AllocateGralloc(gfx::IntSize aSize,
--- a/gfx/layers/opengl/GrallocTextureClient.h
+++ b/gfx/layers/opengl/GrallocTextureClient.h
@@ -73,17 +73,19 @@ public:
   {
     mGrallocFlags = aFlags;
   }
 
   virtual uint8_t* GetBuffer() const MOZ_OVERRIDE;
 
   virtual bool AllocateForSurface(gfx::IntSize aSize) MOZ_OVERRIDE;
 
-  virtual bool AllocateForYCbCr(gfx::IntSize aYSize, gfx::IntSize aCbCrSize) MOZ_OVERRIDE;
+  virtual bool AllocateForYCbCr(gfx::IntSize aYSize,
+                                gfx::IntSize aCbCrSize,
+                                StereoMode aStereoMode) MOZ_OVERRIDE;
 
   bool AllocateGralloc(gfx::IntSize aYSize, uint32_t aAndroidFormat, uint32_t aUsage);
 
   virtual bool Allocate(uint32_t aSize) MOZ_OVERRIDE;
 
   virtual size_t GetBufferSize() const MOZ_OVERRIDE;
 
 protected:
@@ -111,9 +113,9 @@ protected:
    */
   gfx::IntSize mSize;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // MOZ_WIDGET_GONK
-#endif
\ No newline at end of file
+#endif
--- a/gfx/layers/opengl/GrallocTextureHost.cpp
+++ b/gfx/layers/opengl/GrallocTextureHost.cpp
@@ -138,17 +138,17 @@ GrallocTextureSourceOGL::gl() const
 GLenum
 GrallocTextureSourceOGL::GetTextureTarget() const
 {
   MOZ_ASSERT(mGraphicBuffer.get());
   return TextureTargetForAndroidPixelFormat(mGraphicBuffer->getPixelFormat());
 }
 
 gfx::SurfaceFormat
-GrallocTextureSourceOGL::GetFormat() const MOZ_OVERRIDE {
+GrallocTextureSourceOGL::GetFormat() const {
   if (!mGraphicBuffer.get()) {
     return gfx::FORMAT_UNKNOWN;
   }
   if (GetTextureTarget() == LOCAL_GL_TEXTURE_EXTERNAL) {
     return gfx::FORMAT_R8G8B8A8;
   }
   return mFormat;
 }
--- a/gfx/layers/opengl/GrallocTextureHost.h
+++ b/gfx/layers/opengl/GrallocTextureHost.h
@@ -21,49 +21,49 @@ class GrallocTextureSourceOGL : public N
 {
 public:
   friend class GrallocTextureHostOGL;
 
   GrallocTextureSourceOGL(CompositorOGL* aCompositor,
                           android::GraphicBuffer* aGraphicBuffer,
                           gfx::SurfaceFormat aFormat);
 
-  virtual TextureSourceOGL* AsSourceOGL() MOZ_OVERRIDE { return this; }
+  virtual bool IsValid() const MOZ_OVERRIDE;
 
   virtual void BindTexture(GLenum aTextureUnit) MOZ_OVERRIDE;
 
+  virtual void UnbindTexture() MOZ_OVERRIDE {}
+
   virtual gfx::IntSize GetSize() const MOZ_OVERRIDE;
 
+  virtual TextureSourceOGL* AsSourceOGL() MOZ_OVERRIDE { return this; }
+
+  virtual GLenum GetTextureTarget() const MOZ_OVERRIDE;
+
   virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
 
-  virtual GLenum GetTextureTarget() const MOZ_OVERRIDE;
-
   virtual GLenum GetWrapMode() const MOZ_OVERRIDE
   {
     return LOCAL_GL_CLAMP_TO_EDGE;
   }
 
-  virtual void UnbindTexture() MOZ_OVERRIDE {}
-
   void DeallocateDeviceData();
 
   gl::GLContext* gl() const;
 
   void SetCompositor(CompositorOGL* aCompositor)
   {
     mCompositor = aCompositor;
   }
 
   void ForgetBuffer()
   {
     mGraphicBuffer = nullptr;
   }
 
-  bool IsValid() const;
-
   already_AddRefed<gfxImageSurface> GetAsSurface();
 
 protected:
   CompositorOGL* mCompositor;
   android::sp<android::GraphicBuffer> mGraphicBuffer;
   EGLImage mEGLImage;
   gfx::SurfaceFormat mFormat;
 };
@@ -79,18 +79,16 @@ public:
   virtual ~GrallocTextureHostOGL();
 
   virtual void Updated(const nsIntRegion* aRegion) MOZ_OVERRIDE {}
 
   virtual bool Lock() MOZ_OVERRIDE;
 
   virtual void Unlock() MOZ_OVERRIDE;
 
-  virtual bool IsValid() const MOZ_OVERRIDE;
-
   virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
 
   virtual void DeallocateSharedData() MOZ_OVERRIDE;
 
   virtual void DeallocateDeviceData() MOZ_OVERRIDE;
 
   virtual gfx::SurfaceFormat GetFormat() const;
 
@@ -100,16 +98,18 @@ public:
 
   virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE
   {
     return mTextureSource;
   }
 
   virtual already_AddRefed<gfxImageSurface> GetAsSurface() MOZ_OVERRIDE;
 
+  bool IsValid() const;
+
 #ifdef MOZ_LAYERS_HAVE_LOG
   virtual const char* Name() { return "GrallocTextureHostOGL"; }
 #endif
 
 private:
   GrallocBufferActor* mGrallocActor;
   RefPtr<GrallocTextureSourceOGL> mTextureSource;
   gfx::IntSize mSize; // See comment in textureClientOGL.h