Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Unified Diff: ppapi/shared_impl/compositor_layer_data.cc

Issue 298023004: [PPAPI] Compositor API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor_api_def_new
Patch Set: Fix link issue Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/compositor_layer_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/compositor_layer_data.cc
diff --git a/ppapi/shared_impl/compositor_layer_data.cc b/ppapi/shared_impl/compositor_layer_data.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a4b51d379c9a1906fa2aef165fd73d153e8a8797
--- /dev/null
+++ b/ppapi/shared_impl/compositor_layer_data.cc
@@ -0,0 +1,36 @@
+// Copyright 2014 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 "ppapi/shared_impl/compositor_layer_data.h"
+
+namespace ppapi {
+
+namespace {
+
+template<typename T>
+void Copy(scoped_ptr<T>* a, const scoped_ptr<T>& b) {
+ if (b) {
+ if (!(*a))
+ a->reset(new T());
+ **a = *b;
+ } else {
+ a->reset();
+ }
+}
+
+} // namespace
+
+const CompositorLayerData& CompositorLayerData::operator=(
+ const CompositorLayerData& other) {
+ DCHECK(other.is_null() || other.is_valid());
+
+ common = other.common;
+ Copy(&color, other.color);
+ Copy(&texture, other.texture);
+ Copy(&image, other.image);
+
+ return *this;
+}
+
+} // namespace ppapi
« no previous file with comments | « ppapi/shared_impl/compositor_layer_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698