Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / ppapi / shared_impl / compositor_layer_data.cc
bloba4b51d379c9a1906fa2aef165fd73d153e8a8797
1 // Copyright 2014 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 "ppapi/shared_impl/compositor_layer_data.h"
7 namespace ppapi {
9 namespace {
11 template<typename T>
12 void Copy(scoped_ptr<T>* a, const scoped_ptr<T>& b) {
13 if (b) {
14 if (!(*a))
15 a->reset(new T());
16 **a = *b;
17 } else {
18 a->reset();
22 } // namespace
24 const CompositorLayerData& CompositorLayerData::operator=(
25 const CompositorLayerData& other) {
26 DCHECK(other.is_null() || other.is_valid());
28 common = other.common;
29 Copy(&color, other.color);
30 Copy(&texture, other.texture);
31 Copy(&image, other.image);
33 return *this;
36 } // namespace ppapi