forked from mirror/chromium
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The TestRegion class is introduced, and the mock surface now handles region-related methods.
- Loading branch information
1 parent
1637f68
commit a011df3
Showing
6 changed files
with
104 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2019 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 "ui/ozone/platform/wayland/test/test_region.h" | ||
|
||
#include <wayland-server-core.h> | ||
|
||
#include "ui/ozone/platform/wayland/test/server_object.h" | ||
|
||
namespace wl { | ||
|
||
namespace { | ||
|
||
void Destroy(wl_client* client, wl_resource* resource) { | ||
wl_resource_destroy(resource); | ||
} | ||
|
||
void Add(wl_client* client, | ||
wl_resource* resource, | ||
int32_t x, | ||
int32_t y, | ||
int32_t width, | ||
int32_t height) { | ||
GetUserDataAs<SkRegion>(resource)->op(SkIRect::MakeXYWH(x, y, width, height), | ||
SkRegion::kUnion_Op); | ||
} | ||
|
||
static void Subtract(wl_client* client, | ||
wl_resource* resource, | ||
int32_t x, | ||
int32_t y, | ||
int32_t width, | ||
int32_t height) { | ||
GetUserDataAs<SkRegion>(resource)->op(SkIRect::MakeXYWH(x, y, width, height), | ||
SkRegion::kDifference_Op); | ||
} | ||
|
||
} // namespace | ||
|
||
const struct wl_region_interface kTestWlRegionImpl = {Destroy, Add, Subtract}; | ||
|
||
} // namespace wl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2019 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_OZONE_PLATFORM_WAYLAND_TEST_TEST_REGION_H_ | ||
#define UI_OZONE_PLATFORM_WAYLAND_TEST_TEST_REGION_H_ | ||
|
||
#include <wayland-server-protocol-core.h> | ||
|
||
#include "third_party/skia/include/core/SkRegion.h" | ||
|
||
namespace wl { | ||
|
||
extern const struct wl_region_interface kTestWlRegionImpl; | ||
|
||
using TestRegion = SkRegion; | ||
|
||
} // namespace wl | ||
|
||
#endif // UI_OZONE_PLATFORM_WAYLAND_TEST_TEST_REGION_H_ |