forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mojo struct_traits for ozone OverlaySurfaceCandidate
Add struct_traits for OverlaySurfaceCandidate to enable mojo IPC in ozone. BUG=620927 Change-Id: I16a6058f6ef411ab7acfeedc8ba35d080baed674 Reviewed-on: https://chromium-review.googlesource.com/571980 Commit-Queue: Robert Kroeger <rjkroege@chromium.org> Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org> Reviewed-by: Daniel Nicoara <dnicoara@chromium.org> Reviewed-by: Yuzhu Shen <yzshen@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Cr-Commit-Position: refs/heads/master@{#487315}
- Loading branch information
Showing
27 changed files
with
442 additions
and
121 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2017 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. | ||
|
||
module gfx.mojom; | ||
|
||
// gfx::OverlayTransform | ||
enum OverlayTransform { | ||
OVERLAY_TRANSFORM_INVALID, | ||
OVERLAY_TRANSFORM_NONE, | ||
OVERLAY_TRANSFORM_FLIP_HORIZONTAL, | ||
OVERLAY_TRANSFORM_FLIP_VERTICAL, | ||
OVERLAY_TRANSFORM_ROTATE_90, | ||
OVERLAY_TRANSFORM_ROTATE_180, | ||
OVERLAY_TRANSFORM_ROTATE_270, | ||
OVERLAY_TRANSFORM_LAST = OVERLAY_TRANSFORM_ROTATE_270 | ||
}; |
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,11 @@ | ||
# Copyright 2017 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. | ||
|
||
mojom = "//ui/gfx/mojo/overlay_transform.mojom" | ||
public_headers = [ "//ui/gfx/overlay_transform.h" ] | ||
traits_headers = [ "//ui/gfx/mojo/overlay_transform_struct_traits.h" ] | ||
public_deps = [ | ||
"//ui/gfx", | ||
] | ||
type_mappings = [ "gfx.mojom.OverlayTransform=gfx::OverlayTransform" ] |
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,68 @@ | ||
// Copyright 2017 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_GFX_MOJO_OVERLAY_TRANSFORM_STRUCT_TRAITS_H_ | ||
#define UI_GFX_MOJO_OVERLAY_TRANSFORM_STRUCT_TRAITS_H_ | ||
|
||
#include "ui/gfx/mojo/overlay_transform.mojom.h" | ||
#include "ui/gfx/overlay_transform.h" | ||
|
||
namespace mojo { | ||
|
||
template <> | ||
struct EnumTraits<gfx::mojom::OverlayTransform, gfx::OverlayTransform> { | ||
static gfx::mojom::OverlayTransform ToMojom(gfx::OverlayTransform format) { | ||
switch (format) { | ||
case gfx::OverlayTransform::OVERLAY_TRANSFORM_INVALID: | ||
return gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_INVALID; | ||
case gfx::OverlayTransform::OVERLAY_TRANSFORM_NONE: | ||
return gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_NONE; | ||
case gfx::OverlayTransform::OVERLAY_TRANSFORM_FLIP_HORIZONTAL: | ||
return gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_FLIP_HORIZONTAL; | ||
case gfx::OverlayTransform::OVERLAY_TRANSFORM_FLIP_VERTICAL: | ||
return gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_FLIP_VERTICAL; | ||
case gfx::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_90: | ||
return gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_90; | ||
case gfx::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_180: | ||
return gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_180; | ||
case gfx::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_270: | ||
return gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_270; | ||
} | ||
NOTREACHED(); | ||
return gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_INVALID; | ||
} | ||
|
||
static bool FromMojom(gfx::mojom::OverlayTransform input, | ||
gfx::OverlayTransform* out) { | ||
switch (input) { | ||
case gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_INVALID: | ||
*out = gfx::OverlayTransform::OVERLAY_TRANSFORM_INVALID; | ||
return true; | ||
case gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_NONE: | ||
*out = gfx::OverlayTransform::OVERLAY_TRANSFORM_NONE; | ||
return true; | ||
case gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_FLIP_HORIZONTAL: | ||
*out = gfx::OverlayTransform::OVERLAY_TRANSFORM_FLIP_HORIZONTAL; | ||
return true; | ||
case gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_FLIP_VERTICAL: | ||
*out = gfx::OverlayTransform::OVERLAY_TRANSFORM_FLIP_VERTICAL; | ||
return true; | ||
case gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_90: | ||
*out = gfx::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_90; | ||
return true; | ||
case gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_180: | ||
*out = gfx::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_180; | ||
return true; | ||
case gfx::mojom::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_270: | ||
*out = gfx::OverlayTransform::OVERLAY_TRANSFORM_ROTATE_270; | ||
return true; | ||
} | ||
NOTREACHED(); | ||
return false; | ||
} | ||
}; | ||
|
||
} // namespace mojo | ||
|
||
#endif // UI_GFX_MOJO_OVERLAY_TRANSFORM_STRUCT_TRAITS_H_ |
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
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,3 @@ | ||
include_rules = [ | ||
"+mojo/public", | ||
] |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
per-file *.mojom=set noparent | ||
per-file *.mojom=file://ipc/SECURITY_OWNERS | ||
per-file *_struct_traits*.*=set noparent | ||
per-file *_struct_traits*.*=file://ipc/SECURITY_OWNERS | ||
per-file *.typemap=set noparent | ||
per-file *.typemap=file://ipc/SECURITY_OWNERS |
37 changes: 37 additions & 0 deletions
37
ui/ozone/public/interfaces/overlay_surface_candidate.mojom
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,37 @@ | ||
// Copyright 2017 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. | ||
|
||
module ui.ozone.mojom; | ||
|
||
import "ui/gfx/geometry/mojo/geometry.mojom"; | ||
import "ui/gfx/mojo/buffer_types.mojom"; | ||
import "ui/gfx/mojo/overlay_transform.mojom"; | ||
|
||
struct OverlaySurfaceCandidate { | ||
// Transformation to apply to layer during composition. | ||
gfx.mojom.OverlayTransform transform; | ||
// Format of the buffer to composite. | ||
gfx.mojom.BufferFormat format; | ||
// Size of the buffer, in pixels. | ||
gfx.mojom.Size buffer_size; | ||
// Rect on the display to position the overlay to. Input rectangle may | ||
// not have integer coordinates, but when accepting for overlay, must | ||
// be modified by CheckOverlaySupport to output integer values. | ||
gfx.mojom.RectF display_rect; | ||
// Crop within the buffer to be placed inside |display_rect|. | ||
gfx.mojom.RectF crop_rect; | ||
// Quad geometry rect after applying the quad_transform(). | ||
gfx.mojom.Rect quad_rect_in_target_space; | ||
// Clip rect in the target content space after composition. | ||
gfx.mojom.Rect clip_rect; | ||
// If the quad is clipped after composition. | ||
bool is_clipped; | ||
// Stacking order of the overlay plane relative to the main surface, | ||
// which is 0. Signed to allow for "underlays". | ||
int32 plane_z_order = 0; | ||
|
||
// To be modified by the implementer if this candidate can go into | ||
// an overlay. | ||
bool overlay_handled; | ||
}; |
Oops, something went wrong.