Commit 53a16038 authored by Kartikaya Gupta's avatar Kartikaya Gupta
Browse files

Revert tree back to commit 8a362f5c65fb. r=fix-messy-tree

MozReview-Commit-ID: 8ewcbgQsay9
parent fb8cae44
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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/. */

/* THIS FILE IS AUTOGENERATED FROM OfflineAudioCompletionEvent.webidl BY Codegen.py - DO NOT EDIT */

#ifndef mozilla_dom_OfflineAudioCompletionEvent_h
#define mozilla_dom_OfflineAudioCompletionEvent_h

#include "mozilla/Attributes.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/Event.h"
#include "mozilla/dom/OfflineAudioCompletionEventBinding.h"

struct JSContext;
namespace mozilla {
namespace dom {

class OfflineAudioCompletionEvent : public Event
{
public:
  NS_DECL_ISUPPORTS_INHERITED
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(OfflineAudioCompletionEvent, Event)
protected:
  virtual ~OfflineAudioCompletionEvent();
  explicit OfflineAudioCompletionEvent(mozilla::dom::EventTarget* aOwner);

  RefPtr<AudioBuffer> mRenderedBuffer;

public:
  virtual OfflineAudioCompletionEvent* AsOfflineAudioCompletionEvent() override;

  virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;

  static already_AddRefed<OfflineAudioCompletionEvent> Constructor(mozilla::dom::EventTarget* aOwner, const nsAString& aType, const OfflineAudioCompletionEventInit& aEventInitDict);

  static already_AddRefed<OfflineAudioCompletionEvent> Constructor(const GlobalObject& aGlobal, const nsAString& aType, const OfflineAudioCompletionEventInit& aEventInitDict, ErrorResult& aRv);

  AudioBuffer* RenderedBuffer() const;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_OfflineAudioCompletionEvent_h
+1 −13
Original line number Diff line number Diff line
@@ -241,19 +241,7 @@ public:
  /// is is destroyed.
  virtual void CleanupResources() {}

  // Used for WR
  // This call will call the Lock() function and return a TextureSource for WR
  // composition.
  virtual TextureSource* BindTextureSource()
  {
    MOZ_RELEASE_ASSERT(true, "No implementation for BindTextureSource()");

    return nullptr;
  }
  virtual void UnbindTextureSource()
  {
    MOZ_RELEASE_ASSERT(true, "No implementation for UnindTextureSource()");
  }
  virtual void BindTextureSource() {}

protected:
  TextureInfo mTextureInfo;
+8 −24
Original line number Diff line number Diff line
@@ -434,20 +434,14 @@ ImageHost::Composite(LayerComposite* aLayer,
      mBias);
}

TextureSource*
void
ImageHost::BindTextureSource()
{
  int imageIndex = ChooseImageIndex();
  if (imageIndex < 0) {
    return nullptr;
    return;
  }

  mBias = UpdateBias(GetCompositor()->GetCompositionTime(),
                     mImages[imageIndex].mTimeStamp,
                     uint32_t(imageIndex + 1) < mImages.Length() ?
                         mImages[imageIndex + 1].mTimeStamp :TimeStamp(),
                     mBias);

  if (uint32_t(imageIndex) + 1 < mImages.Length()) {
    GetCompositor()->CompositeUntil(mImages[imageIndex + 1].mTimeStamp + TimeDuration::FromMilliseconds(BIAS_TIME_MS));
  }
@@ -456,23 +450,13 @@ ImageHost::BindTextureSource()
  img->mTextureHost->SetCompositor(GetCompositor());
  SetCurrentTextureHost(img->mTextureHost);

  // XXX: handle the lock failed in UnbindTextureSource()
  if (!Lock()) {
    MOZ_RELEASE_ASSERT(false, "ImageHost::BindTextureSource() locks failed");
    return nullptr;
  }
  if (!mCurrentTextureHost->BindTextureSource(mCurrentTextureSource)) {
    MOZ_RELEASE_ASSERT(false, "ImageHost::BindTextureSource() binds textureSource failed");
    return nullptr;
  }

  return mCurrentTextureSource.get();
}
  // XXX Add TextureSource binding

void
ImageHost::UnbindTextureSource()
{
  Unlock();
  mBias = UpdateBias(
      GetCompositor()->GetCompositionTime(), mImages[imageIndex].mTimeStamp,
      uint32_t(imageIndex + 1) < mImages.Length() ?
          mImages[imageIndex + 1].mTimeStamp : TimeStamp(),
      mBias);
}

void
+1 −2
Original line number Diff line number Diff line
@@ -91,8 +91,7 @@ public:

  virtual void CleanupResources() override;

  virtual TextureSource* BindTextureSource() override;
  virtual void UnbindTextureSource() override;
  virtual void BindTextureSource() override;

  int32_t GetFrameID()
  {
+1 −8
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ class ISurfaceAllocator;
class TextureHostOGL;
class TextureReadLock;
class TextureSourceOGL;
class TextureSourceWebRenderOGL;
class TextureSourceD3D9;
class TextureSourceD3D11;
class TextureSourceBasic;
@@ -117,16 +116,10 @@ public:
  /**
   * Cast to a TextureSource for for each backend..
   */
  virtual TextureSourceOGL* AsSourceOGL()
  {
  virtual TextureSourceOGL* AsSourceOGL() {
    gfxCriticalNote << "Failed to cast " << Name() << " into a TextureSourceOGL";
    return nullptr;
  }
  virtual TextureSourceWebRenderOGL* AsSourceWebRenderOGL()
  {
    gfxCriticalNote << "Failed to cast " << Name() << " into a TextureSourceWebRenderOGL";
    return nullptr;
  }
  virtual TextureSourceD3D9* AsSourceD3D9() { return nullptr; }
  virtual TextureSourceD3D11* AsSourceD3D11() { return nullptr; }
  virtual TextureSourceBasic* AsSourceBasic() { return nullptr; }
Loading