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.
7 #if USE(ACCELERATED_COMPOSITING)
9 #include "IOSurfaceLayerChromium.h"
11 #include "CCIOSurfaceLayerImpl.h"
15 scoped_refptr
<IOSurfaceLayerChromium
> IOSurfaceLayerChromium::create()
17 return make_scoped_refptr(new IOSurfaceLayerChromium());
20 IOSurfaceLayerChromium::IOSurfaceLayerChromium()
26 IOSurfaceLayerChromium::~IOSurfaceLayerChromium()
30 void IOSurfaceLayerChromium::setIOSurfaceProperties(uint32_t ioSurfaceId
, const IntSize
& size
)
32 m_ioSurfaceId
= ioSurfaceId
;
33 m_ioSurfaceSize
= size
;
37 PassOwnPtr
<CCLayerImpl
> IOSurfaceLayerChromium::createCCLayerImpl()
39 return CCIOSurfaceLayerImpl::create(m_layerId
);
42 bool IOSurfaceLayerChromium::drawsContent() const
44 return m_ioSurfaceId
&& LayerChromium::drawsContent();
47 void IOSurfaceLayerChromium::pushPropertiesTo(CCLayerImpl
* layer
)
49 LayerChromium::pushPropertiesTo(layer
);
51 CCIOSurfaceLayerImpl
* textureLayer
= static_cast<CCIOSurfaceLayerImpl
*>(layer
);
52 textureLayer
->setIOSurfaceProperties(m_ioSurfaceId
, m_ioSurfaceSize
);
56 #endif // USE(ACCELERATED_COMPOSITING)