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.
mus/gpu: Introduce the GpuServiceHost mojom interface.
GpuServiceInternal uses the new host interface to notify the window server when something happens. The window server does not actually do anything in response yet. BUG=643746, 630895 Review-Url: https://codereview.chromium.org/2559113002 Cr-Commit-Position: refs/heads/master@{#437335}
- Loading branch information
Showing
14 changed files
with
222 additions
and
59 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
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,15 @@ | ||
// Copyright 2016 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.mojom; | ||
|
||
enum ContextLostReason { | ||
GUILTY, | ||
INNOCENT, | ||
UNKNOWN, | ||
OUT_OF_MEMORY, | ||
MAKE_CURRENT_FAILED, | ||
GPU_CHANNEL_LOST, | ||
INVALID_GPU_MESSAGE, | ||
}; |
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,12 @@ | ||
# Copyright 2016 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 = "//services/ui/gpu/interfaces/context_lost_reason.mojom" | ||
public_headers = [ "//gpu/command_buffer/common/constants.h" ] | ||
traits_headers = [ "//services/ui/gpu/interfaces/context_lost_reason_traits.h" ] | ||
public_deps = [ | ||
"//gpu/command_buffer/common", | ||
] | ||
|
||
type_mappings = [ "ui.mojom.ContextLostReason=gpu::error::ContextLostReason" ] |
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 2016 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 SERVICES_UI_GPU_INTERFACES_CONTEXT_LOST_REASON_TRAITS_H_ | ||
#define SERVICES_UI_GPU_INTERFACES_CONTEXT_LOST_REASON_TRAITS_H_ | ||
|
||
#include "gpu/command_buffer/common/constants.h" | ||
#include "services/ui/gpu/interfaces/context_lost_reason.mojom.h" | ||
|
||
namespace mojo { | ||
|
||
template <> | ||
struct EnumTraits<ui::mojom::ContextLostReason, gpu::error::ContextLostReason> { | ||
static ui::mojom::ContextLostReason ToMojom( | ||
gpu::error::ContextLostReason reason) { | ||
switch (reason) { | ||
case gpu::error::kGuilty: | ||
return ui::mojom::ContextLostReason::GUILTY; | ||
case gpu::error::kInnocent: | ||
return ui::mojom::ContextLostReason::INNOCENT; | ||
case gpu::error::kUnknown: | ||
return ui::mojom::ContextLostReason::UNKNOWN; | ||
case gpu::error::kOutOfMemory: | ||
return ui::mojom::ContextLostReason::OUT_OF_MEMORY; | ||
case gpu::error::kMakeCurrentFailed: | ||
return ui::mojom::ContextLostReason::MAKE_CURRENT_FAILED; | ||
case gpu::error::kGpuChannelLost: | ||
return ui::mojom::ContextLostReason::GPU_CHANNEL_LOST; | ||
case gpu::error::kInvalidGpuMessage: | ||
return ui::mojom::ContextLostReason::INVALID_GPU_MESSAGE; | ||
} | ||
NOTREACHED(); | ||
return ui::mojom::ContextLostReason::UNKNOWN; | ||
} | ||
|
||
static bool FromMojom(ui::mojom::ContextLostReason reason, | ||
gpu::error::ContextLostReason* out) { | ||
switch (reason) { | ||
case ui::mojom::ContextLostReason::GUILTY: | ||
*out = gpu::error::kGuilty; | ||
return true; | ||
case ui::mojom::ContextLostReason::INNOCENT: | ||
*out = gpu::error::kInnocent; | ||
return true; | ||
case ui::mojom::ContextLostReason::UNKNOWN: | ||
*out = gpu::error::kUnknown; | ||
return true; | ||
case ui::mojom::ContextLostReason::OUT_OF_MEMORY: | ||
*out = gpu::error::kOutOfMemory; | ||
return true; | ||
case ui::mojom::ContextLostReason::MAKE_CURRENT_FAILED: | ||
*out = gpu::error::kMakeCurrentFailed; | ||
return true; | ||
case ui::mojom::ContextLostReason::GPU_CHANNEL_LOST: | ||
*out = gpu::error::kGpuChannelLost; | ||
return true; | ||
case ui::mojom::ContextLostReason::INVALID_GPU_MESSAGE: | ||
*out = gpu::error::kInvalidGpuMessage; | ||
return true; | ||
} | ||
return false; | ||
} | ||
}; | ||
|
||
} // namespace mojo | ||
|
||
#endif // SERVICES_UI_GPU_INTERFACES_CONTEXT_LOST_REASON_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2016 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.mojom; | ||
|
||
import "gpu/ipc/common/gpu_info.mojom"; | ||
import "services/ui/gpu/interfaces/context_lost_reason.mojom"; | ||
import "url/mojo/url.mojom"; | ||
|
||
interface GpuServiceHost { | ||
DidInitialize(gpu.mojom.GpuInfo gpu_info); | ||
DidCreateOffscreenContext(url.mojom.Url url); | ||
DidDestroyOffscreenContext(url.mojom.Url url); | ||
|
||
DidDestroyChannel(int32 client_id); | ||
DidLoseContext(bool offscreen, | ||
ContextLostReason reason, | ||
url.mojom.Url active_url); | ||
|
||
StoreShaderToDisk(int32 client_id, string key, string shader); | ||
}; |
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 @@ | ||
typemaps = [ "//services/ui/gpu/interfaces/context_lost_reason.typemap" ] |
Oops, something went wrong.