From cc3cfaa706818aee30e0a766f3d4ffe90301ae33 Mon Sep 17 00:00:00 2001 From: "jamesr@chromium.org" Date: Mon, 18 Mar 2013 09:05:52 +0000 Subject: Part 10 of cc/ directory shuffles: layers Continuation of https://src.chromium.org/viewvc/chrome?view=rev&revision=188681 BUG=190824 TBR=enne@chromium.org, piman@chromium.org, jschuh@chromium.org, joth@chromium.org Review URL: https://codereview.chromium.org/12916002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188703 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/layers/io_surface_layer.cc | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 cc/layers/io_surface_layer.cc (limited to 'cc/layers/io_surface_layer.cc') diff --git a/cc/layers/io_surface_layer.cc b/cc/layers/io_surface_layer.cc new file mode 100644 index 0000000..3ccbdd9 --- /dev/null +++ b/cc/layers/io_surface_layer.cc @@ -0,0 +1,43 @@ +// Copyright 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "cc/layers/io_surface_layer.h" + +#include "cc/layers/io_surface_layer_impl.h" + +namespace cc { + +scoped_refptr IOSurfaceLayer::Create() { + return make_scoped_refptr(new IOSurfaceLayer()); +} + +IOSurfaceLayer::IOSurfaceLayer() : Layer(), io_surface_id_(0) {} + +IOSurfaceLayer::~IOSurfaceLayer() {} + +void IOSurfaceLayer::SetIOSurfaceProperties(uint32_t io_surface_id, + gfx::Size size) { + io_surface_id_ = io_surface_id; + io_surface_size_ = size; + SetNeedsCommit(); +} + +scoped_ptr IOSurfaceLayer::CreateLayerImpl( + LayerTreeImpl* tree_impl) { + return IOSurfaceLayerImpl::Create(tree_impl, layer_id_).PassAs(); +} + +bool IOSurfaceLayer::DrawsContent() const { + return io_surface_id_ && Layer::DrawsContent(); +} + +void IOSurfaceLayer::PushPropertiesTo(LayerImpl* layer) { + Layer::PushPropertiesTo(layer); + + IOSurfaceLayerImpl* io_surface_layer = + static_cast(layer); + io_surface_layer->SetIOSurfaceProperties(io_surface_id_, io_surface_size_); +} + +} // namespace cc -- cgit v1.1