gfx/layers/client/ClientContainerLayer.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/layers/client/ClientContainerLayer.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "ClientContainerLayer.h"
    1.10 +#include "ClientLayerManager.h"         // for ClientLayerManager, etc
    1.11 +#include "mozilla/mozalloc.h"           // for operator new
    1.12 +#include "nsAutoPtr.h"                  // for nsRefPtr
    1.13 +#include "nsCOMPtr.h"                   // for already_AddRefed
    1.14 +#include "nsISupportsImpl.h"            // for Layer::AddRef, etc
    1.15 +
    1.16 +namespace mozilla {
    1.17 +namespace layers {
    1.18 +
    1.19 +already_AddRefed<ContainerLayer>
    1.20 +ClientLayerManager::CreateContainerLayer()
    1.21 +{
    1.22 +  NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
    1.23 +  nsRefPtr<ClientContainerLayer> layer =
    1.24 +    new ClientContainerLayer(this);
    1.25 +  CREATE_SHADOW(Container);
    1.26 +  return layer.forget();
    1.27 +}
    1.28 +
    1.29 +already_AddRefed<RefLayer>
    1.30 +ClientLayerManager::CreateRefLayer()
    1.31 +{
    1.32 +  NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
    1.33 +  nsRefPtr<ClientRefLayer> layer =
    1.34 +    new ClientRefLayer(this);
    1.35 +  CREATE_SHADOW(Ref);
    1.36 +  return layer.forget();
    1.37 +}
    1.38 +
    1.39 +}
    1.40 +}

mercurial