OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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. |
| 4 |
| 5 #include "components/native_app_window/draggable_region.h" |
| 6 |
| 7 #include "third_party/skia/include/core/SkRegion.h" |
| 8 |
| 9 namespace native_app_window { |
| 10 |
| 11 DraggableRegion::DraggableRegion() : draggable(false) { |
| 12 } |
| 13 |
| 14 SkRegion* RawDraggableRegionsToSkRegion( |
| 15 const std::vector<DraggableRegion>& regions) { |
| 16 SkRegion* sk_region = new SkRegion; |
| 17 for (std::vector<DraggableRegion>::const_iterator iter = regions.begin(); |
| 18 iter != regions.end(); |
| 19 ++iter) { |
| 20 const DraggableRegion& region = *iter; |
| 21 sk_region->op( |
| 22 region.bounds.x(), |
| 23 region.bounds.y(), |
| 24 region.bounds.right(), |
| 25 region.bounds.bottom(), |
| 26 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 27 } |
| 28 return sk_region; |
| 29 } |
| 30 |
| 31 } // namespace native_app_window |
OLD | NEW |