blob: 0deb2ba9e55d37cd2fcdfe4d027978ced4a47880 [file] [log] [blame]
Mathias Agopian20f68782009-05-11 00:03:41 -07001/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "Region"
18
19#include <stdio.h>
20#include <utils/Debug.h>
21#include <ui/Rect.h>
22#include <ui/Region.h>
23
24using namespace android;
25
26int main()
27{
28 Region reg0( Rect( 0, 0, 100, 100 ) );
29 Region reg1 = reg0;
30 Region reg2, reg3;
31
32 reg0.dump("reg0");
33 reg1.dump("reg1");
34
35 reg0 = reg0 | reg0.translate(150, 0);
36 reg0.dump("reg0");
37 reg1.dump("reg1");
38
39 reg0 = reg0 | reg0.translate(300, 0);
40 reg0.dump("reg0");
41 reg1.dump("reg1");
42
43 //reg2 = reg0 | reg0.translate(0, 100);
44 //reg0.dump("reg0");
45 //reg1.dump("reg1");
46 //reg2.dump("reg2");
47
48 //reg3 = reg0 | reg0.translate(0, 150);
49 //reg0.dump("reg0");
50 //reg1.dump("reg1");
51 //reg2.dump("reg2");
52 //reg3.dump("reg3");
53
54 LOGD("---");
55 reg2 = reg0 | reg0.translate(100, 0);
56 reg0.dump("reg0");
57 reg1.dump("reg1");
58 reg2.dump("reg2");
59
60 return 0;
61}
62