1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/io_surface_layer.h"
7 #include "cc/io_surface_layer_impl.h"
11 scoped_refptr
<IOSurfaceLayer
> IOSurfaceLayer::create()
13 return make_scoped_refptr(new IOSurfaceLayer());
16 IOSurfaceLayer::IOSurfaceLayer()
22 IOSurfaceLayer::~IOSurfaceLayer()
26 void IOSurfaceLayer::setIOSurfaceProperties(uint32_t ioSurfaceId
, const gfx::Size
& size
)
28 m_ioSurfaceId
= ioSurfaceId
;
29 m_ioSurfaceSize
= size
;
33 scoped_ptr
<LayerImpl
> IOSurfaceLayer::createLayerImpl(LayerTreeHostImpl
* hostImpl
)
35 return IOSurfaceLayerImpl::create(hostImpl
, m_layerId
).PassAs
<LayerImpl
>();
38 bool IOSurfaceLayer::drawsContent() const
40 return m_ioSurfaceId
&& Layer::drawsContent();
43 void IOSurfaceLayer::pushPropertiesTo(LayerImpl
* layer
)
45 Layer::pushPropertiesTo(layer
);
47 IOSurfaceLayerImpl
* ioSurfaceLayer
= static_cast<IOSurfaceLayerImpl
*>(layer
);
48 ioSurfaceLayer
->setIOSurfaceProperties(m_ioSurfaceId
, m_ioSurfaceSize
);