blob: cf42fd1eda95c410c8bbc19e0fa89cd635d766e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// 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.
#ifndef UI_BASE_GFX_SCOPED_REGION_GFX_H_
#define UI_BASE_GFX_SCOPED_REGION_GFX_H_
#pragma once
#include "third_party/skia/include/core/SkRegion.h"
namespace gfx {
// Wraps an SkRegion.
class ScopedSkRegion {
public:
ScopedSkRegion() : region_(NULL) {}
explicit ScopedSkRegion(SkRegion* region) : region_(region) {}
~ScopedSkRegion() {
delete region_;
}
void Set(SkRegion* region) {
delete region_;
region_ = region;
}
SkRegion* Get() {
return region_;
}
SkRegion* release() {
SkRegion* region = region_;
region_ = NULL;
return region;
}
private:
SkRegion* region_;
DISALLOW_COPY_AND_ASSIGN(ScopedSkRegion);
};
} // namespace gfx
#endif // UI_BASE_GFX_SCOPED_REGION_GFX_H_
|