Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: components/mus/public/cpp/surfaces/surfaces_type_converters.cc

Issue 2014233002: Implement cc::SurfaceId StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/mus/public/cpp/surfaces/surfaces_type_converters.cc
diff --git a/components/mus/public/cpp/surfaces/surfaces_type_converters.cc b/components/mus/public/cpp/surfaces/surfaces_type_converters.cc
index b2f64dcca826030865e7cea2846f0aa51fdfef86..1628079a36a7ca56af2e894c44b5be5730e9d70d 100644
--- a/components/mus/public/cpp/surfaces/surfaces_type_converters.cc
+++ b/components/mus/public/cpp/surfaces/surfaces_type_converters.cc
@@ -51,8 +51,6 @@ using mus::mojom::SharedQuadState;
using mus::mojom::SharedQuadStatePtr;
using mus::mojom::SolidColorQuadState;
using mus::mojom::SolidColorQuadStatePtr;
-using mus::mojom::SurfaceId;
-using mus::mojom::SurfaceIdPtr;
using mus::mojom::SurfaceQuadState;
using mus::mojom::SurfaceQuadStatePtr;
using mus::mojom::TextureQuadState;
@@ -174,12 +172,9 @@ bool ConvertDrawQuad(const QuadPtr& input,
cc::SurfaceDrawQuad* surface_quad =
render_pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>();
surface_quad->SetAll(
- sqs,
- input->rect.To<gfx::Rect>(),
- input->opaque_rect.To<gfx::Rect>(),
- input->visible_rect.To<gfx::Rect>(),
- input->needs_blending,
- input->surface_quad_state->surface.To<cc::SurfaceId>());
+ sqs, input->rect.To<gfx::Rect>(), input->opaque_rect.To<gfx::Rect>(),
+ input->visible_rect.To<gfx::Rect>(), input->needs_blending,
+ input->surface_quad_state->surface);
break;
}
case mus::mojom::Material::TEXTURE_CONTENT: {
@@ -253,22 +248,6 @@ bool ConvertDrawQuad(const QuadPtr& input,
} // namespace
// static
-SurfaceIdPtr TypeConverter<SurfaceIdPtr, cc::SurfaceId>::Convert(
- const cc::SurfaceId& input) {
- SurfaceIdPtr id(SurfaceId::New());
- id->id_namespace = input.id_namespace();
- id->local_id = input.local_id();
- id->nonce = input.nonce();
- return id;
-}
-
-// static
-cc::SurfaceId TypeConverter<cc::SurfaceId, SurfaceIdPtr>::Convert(
- const SurfaceIdPtr& input) {
- return cc::SurfaceId(input->id_namespace, input->local_id, input->nonce);
-}
-
-// static
ColorPtr TypeConverter<ColorPtr, SkColor>::Convert(const SkColor& input) {
ColorPtr color(Color::New());
color->rgba = input;
@@ -354,7 +333,7 @@ QuadPtr TypeConverter<QuadPtr, cc::DrawQuad>::Convert(
cc::SurfaceDrawQuad::MaterialCast(&input);
SurfaceQuadStatePtr surface_state =
SurfaceQuadState::New();
- surface_state->surface = SurfaceId::From(surface_quad->surface_id);
+ surface_state->surface = surface_quad->surface_id;
quad->surface_quad_state = std::move(surface_state);
break;
}

Powered by Google App Engine
This is Rietveld 408576698