Index: components/native_app_window/draggable_region.cc |
diff --git a/components/native_app_window/draggable_region.cc b/components/native_app_window/draggable_region.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4648a141cfb8fd9d733d84785d1c992ed9458711 |
--- /dev/null |
+++ b/components/native_app_window/draggable_region.cc |
@@ -0,0 +1,31 @@ |
+// Copyright (c) 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 "components/native_app_window/draggable_region.h" |
+ |
+#include "third_party/skia/include/core/SkRegion.h" |
+ |
+namespace native_app_window { |
+ |
+DraggableRegion::DraggableRegion() : draggable(false) { |
+} |
+ |
+SkRegion* RawDraggableRegionsToSkRegion( |
+ const std::vector<DraggableRegion>& regions) { |
+ SkRegion* sk_region = new SkRegion; |
+ for (std::vector<DraggableRegion>::const_iterator iter = regions.begin(); |
+ iter != regions.end(); |
+ ++iter) { |
+ const DraggableRegion& region = *iter; |
+ sk_region->op( |
+ region.bounds.x(), |
+ region.bounds.y(), |
+ region.bounds.right(), |
+ region.bounds.bottom(), |
+ region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
+ } |
+ return sk_region; |
+} |
+ |
+} // namespace native_app_window |