Remove support for specifying version on command line.
[chromium-blink-merge.git] / ui / base / gtk / scoped_region.cc
blob729e3c3a6f74fdf7e15263f1b0ef15701fdbf5dc
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.
5 #include "ui/base/gtk/scoped_region.h"
7 #include <gdk/gdk.h>
9 namespace ui {
11 ScopedRegion::ScopedRegion() : region_(NULL) {}
13 ScopedRegion::ScopedRegion(GdkRegion* region) : region_(region) {}
15 ScopedRegion::~ScopedRegion() {
16 Close();
19 void ScopedRegion::Set(GdkRegion* region) {
20 Close();
21 region_ = region;
24 GdkRegion* ScopedRegion::Get() {
25 return region_;
28 GdkRegion* ScopedRegion::release() {
29 GdkRegion* region = region_;
30 region_ = NULL;
31 return region;
34 void ScopedRegion::Close() {
35 if (region_) {
36 gdk_region_destroy(region_);
37 region_ = NULL;
41 } // namespace ui