#include "ui/gfx/mojom/ca_layer_result_mojom_traits.h"
#include "build/build_config.h"
namespace mojo {
#if BUILDFLAG(IS_APPLE)
gfx::mojom::CALayerResult
EnumTraits<gfx::mojom::CALayerResult, gfx::CALayerResult>::ToMojom(
gfx::CALayerResult ca_layer_error_code) {
switch (ca_layer_error_code) {
case gfx::kCALayerSuccess:
return gfx::mojom::CALayerResult::kCALayerSuccess;
case gfx::kCALayerFailedUnknown:
return gfx::mojom::CALayerResult::kCALayerFailedUnknown;
case gfx::kCALayerFailedStreamVideoNotCandidate:
return gfx::mojom::CALayerResult::kCALayerFailedStreamVideoNotCandidate;
case gfx::kCALayerFailedTextureNotCandidate:
return gfx::mojom::CALayerResult::kCALayerFailedTextureNotCandidate;
case gfx::kCALayerFailedTileNotCandidate:
return gfx::mojom::CALayerResult::kCALayerFailedTileNotCandidate;
case gfx::kCALayerFailedQuadBlendMode:
return gfx::mojom::CALayerResult::kCALayerFailedQuadBlendMode;
case gfx::kCALayerFailedQuadClipping:
return gfx::mojom::CALayerResult::kCALayerFailedQuadClipping;
case gfx::kCALayerFailedDebugBoarder:
return gfx::mojom::CALayerResult::kCALayerFailedDebugBoarder;
case gfx::kCALayerFailedPictureContent:
return gfx::mojom::CALayerResult::kCALayerFailedPictureContent;
case gfx::kCALayerFailedSurfaceContent:
return gfx::mojom::CALayerResult::kCALayerFailedSurfaceContent;
case gfx::kCALayerFailedDifferentClipSettings:
return gfx::mojom::CALayerResult::kCALayerFailedDifferentClipSettings;
case gfx::kCALayerFailedDifferentVertexOpacities:
return gfx::mojom::CALayerResult::kCALayerFailedDifferentVertexOpacities;
case gfx::kCALayerFailedRenderPassBackdropFilters:
return gfx::mojom::CALayerResult::kCALayerFailedRenderPassBackdropFilters;
case gfx::kCALayerFailedRenderPassPassMask:
return gfx::mojom::CALayerResult::kCALayerFailedRenderPassPassMask;
case gfx::kCALayerFailedRenderPassFilterOperation:
return gfx::mojom::CALayerResult::kCALayerFailedRenderPassFilterOperation;
case gfx::kCALayerFailedRenderPassSortingContextId:
return gfx::mojom::CALayerResult::
kCALayerFailedRenderPassSortingContextId;
case gfx::kCALayerFailedTooManyRenderPassDrawQuads:
return gfx::mojom::CALayerResult::
kCALayerFailedTooManyRenderPassDrawQuads;
case gfx::kCALayerFailedQuadRoundedCornerNotUniform:
return gfx::mojom::CALayerResult::
kCALayerFailedQuadRoundedCornerNotUniform;
case gfx::kCALayerFailedTooManyQuads:
return gfx::mojom::CALayerResult::kCALayerFailedTooManyQuads;
case gfx::kCALayerFailedYUVNotCandidate:
return gfx::mojom::CALayerResult::kCALayerFailedYUVNotCandidate;
case gfx::kCALayerFailedYUVTexcoordMismatch:
return gfx::mojom::CALayerResult::kCALayerFailedYUVTexcoordMismatch;
case gfx::kCALayerFailedYUVInvalidPlanes:
return gfx::mojom::CALayerResult::kCALayerFailedYUVInvalidPlanes;
case gfx::kCALayerFailedCopyRequests:
return gfx::mojom::CALayerResult::kCALayerFailedCopyRequests;
case gfx::kCALayerFailedOverlayDisabled:
return gfx::mojom::CALayerResult::kCALayerFailedOverlayDisabled;
case gfx::kCALayerFailedVideoCaptureEnabled:
return gfx::mojom::CALayerResult::kCALayerFailedVideoCaptureEnabled;
case gfx::kCALayerUnknownDidNotSwap:
NOTREACHED_IN_MIGRATION();
return gfx::mojom::CALayerResult::kCALayerFailedUnknown;
case gfx::kCALayerUnknownNoWidget:
NOTREACHED_IN_MIGRATION();
return gfx::mojom::CALayerResult::kCALayerFailedUnknown;
}
NOTREACHED_IN_MIGRATION() << "CALayer result:" << ca_layer_error_code;
return gfx::mojom::CALayerResult::kCALayerFailedUnknown;
}
bool EnumTraits<gfx::mojom::CALayerResult, gfx::CALayerResult>::FromMojom(
gfx::mojom::CALayerResult input,
gfx::CALayerResult* out) {
switch (input) {
case gfx::mojom::CALayerResult::kCALayerSuccess:
*out = gfx::kCALayerSuccess;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedUnknown:
*out = gfx::kCALayerFailedUnknown;
return true;
case gfx::mojom::CALayerResult::
kCALayerFailedStreamVideoNotCandidate:
*out = gfx::kCALayerFailedStreamVideoNotCandidate;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedTextureNotCandidate:
*out = gfx::kCALayerFailedTextureNotCandidate;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedTileNotCandidate:
*out = gfx::kCALayerFailedTileNotCandidate;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedQuadBlendMode:
*out = gfx::kCALayerFailedQuadBlendMode;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedQuadClipping:
*out = gfx::kCALayerFailedQuadClipping;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedDebugBoarder:
*out = gfx::kCALayerFailedDebugBoarder;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedPictureContent:
*out = gfx::kCALayerFailedPictureContent;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedSurfaceContent:
*out = gfx::kCALayerFailedSurfaceContent;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedDifferentClipSettings:
*out = gfx::kCALayerFailedDifferentClipSettings;
return true;
case gfx::mojom::CALayerResult::
kCALayerFailedDifferentVertexOpacities:
*out = gfx::kCALayerFailedDifferentVertexOpacities;
return true;
case gfx::mojom::CALayerResult::
kCALayerFailedRenderPassBackdropFilters:
*out = gfx::kCALayerFailedRenderPassBackdropFilters;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedRenderPassPassMask:
*out = gfx::kCALayerFailedRenderPassPassMask;
return true;
case gfx::mojom::CALayerResult::
kCALayerFailedRenderPassFilterOperation:
*out = gfx::kCALayerFailedRenderPassFilterOperation;
return true;
case gfx::mojom::CALayerResult::
kCALayerFailedRenderPassSortingContextId:
*out = gfx::kCALayerFailedRenderPassSortingContextId;
return true;
case gfx::mojom::CALayerResult::
kCALayerFailedTooManyRenderPassDrawQuads:
*out = gfx::kCALayerFailedTooManyRenderPassDrawQuads;
return true;
case gfx::mojom::CALayerResult::
kCALayerFailedQuadRoundedCornerNotUniform:
*out = gfx::kCALayerFailedQuadRoundedCornerNotUniform;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedTooManyQuads:
*out = gfx::kCALayerFailedTooManyQuads;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedYUVNotCandidate:
*out = gfx::kCALayerFailedYUVNotCandidate;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedYUVTexcoordMismatch:
*out = gfx::kCALayerFailedYUVTexcoordMismatch;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedYUVInvalidPlanes:
*out = gfx::kCALayerFailedYUVInvalidPlanes;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedCopyRequests:
*out = gfx::kCALayerFailedCopyRequests;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedOverlayDisabled:
*out = gfx::kCALayerFailedOverlayDisabled;
return true;
case gfx::mojom::CALayerResult::kCALayerFailedVideoCaptureEnabled:
*out = gfx::kCALayerFailedVideoCaptureEnabled;
return true;
}
NOTREACHED_IN_MIGRATION() << "Invalid CALayer result: " << input;
return false;
}
#endif
}