diff options
author | jackhou <jackhou@chromium.org> | 2014-12-03 21:24:44 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-04 05:25:03 +0000 |
commit | 10c9af41a73ac7db787d64344630f8200925cfe5 (patch) | |
tree | c2fe05f5439b39c9d9409b362a29577863469609 /mojo | |
parent | edbe9193bddce5f58e9070e219735363cdc27191 (diff) | |
download | chromium_src-10c9af41a73ac7db787d64344630f8200925cfe5.zip chromium_src-10c9af41a73ac7db787d64344630f8200925cfe5.tar.gz chromium_src-10c9af41a73ac7db787d64344630f8200925cfe5.tar.bz2 |
[cc] Add nearest neighbor filtering for TextureLayer.
Blink side is here (depends on this CL):
https://codereview.chromium.org/562583002/
This CL also depends on another blink side change here:
https://codereview.chromium.org/699103002/
BUG=134040
Review URL: https://codereview.chromium.org/558083002
Cr-Commit-Position: refs/heads/master@{#306768}
Diffstat (limited to 'mojo')
-rw-r--r-- | mojo/converters/surfaces/surfaces_type_converters.cc | 3 | ||||
-rw-r--r-- | mojo/converters/surfaces/tests/surface_unittest.cc | 8 | ||||
-rw-r--r-- | mojo/services/public/interfaces/surfaces/quads.mojom | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/mojo/converters/surfaces/surfaces_type_converters.cc b/mojo/converters/surfaces/surfaces_type_converters.cc index a8e5911..1a6ab99 100644 --- a/mojo/converters/surfaces/surfaces_type_converters.cc +++ b/mojo/converters/surfaces/surfaces_type_converters.cc @@ -140,7 +140,8 @@ bool ConvertDrawQuad(const QuadPtr& input, texture_quad_state->uv_bottom_right.To<gfx::PointF>(), texture_quad_state->background_color.To<SkColor>(), &texture_quad_state->vertex_opacity.storage()[0], - texture_quad_state->flipped); + texture_quad_state->flipped, + texture_quad_state->nearest_neighbor); break; } case MATERIAL_TILED_CONTENT: { diff --git a/mojo/converters/surfaces/tests/surface_unittest.cc b/mojo/converters/surfaces/tests/surface_unittest.cc index 4b1fd21..cdfb9cb 100644 --- a/mojo/converters/surfaces/tests/surface_unittest.cc +++ b/mojo/converters/surfaces/tests/surface_unittest.cc @@ -108,6 +108,7 @@ TEST_F(SurfaceLibQuadTest, TextureQuad) { SkColor background_color = SK_ColorYELLOW; float vertex_opacity[4] = {0.1f, 0.5f, 0.4f, 0.8f}; bool flipped = false; + bool nearest_neighbor = false; texture_quad->SetAll(sqs, rect, opaque_rect, @@ -119,7 +120,8 @@ TEST_F(SurfaceLibQuadTest, TextureQuad) { uv_bottom_right, background_color, vertex_opacity, - flipped); + flipped, + nearest_neighbor); QuadPtr mojo_quad = Quad::From<cc::DrawQuad>(*texture_quad); ASSERT_FALSE(mojo_quad.is_null()); @@ -267,6 +269,7 @@ TEST(SurfaceLibTest, RenderPass) { SkColor background_color = SK_ColorYELLOW; float vertex_opacity[4] = {0.1f, 0.5f, 0.4f, 0.8f}; bool flipped = false; + bool nearest_neighbor = false; texture_quad->SetAll(sqs, rect, opaque_rect, @@ -278,7 +281,8 @@ TEST(SurfaceLibTest, RenderPass) { uv_bottom_right, background_color, vertex_opacity, - flipped); + flipped, + nearest_neighbor); PassPtr mojo_pass = Pass::From(*pass); ASSERT_FALSE(mojo_pass.is_null()); diff --git a/mojo/services/public/interfaces/surfaces/quads.mojom b/mojo/services/public/interfaces/surfaces/quads.mojom index d635239..61115f7 100644 --- a/mojo/services/public/interfaces/surfaces/quads.mojom +++ b/mojo/services/public/interfaces/surfaces/quads.mojom @@ -64,6 +64,7 @@ struct TextureQuadState { Color background_color; array<float, 4> vertex_opacity; bool flipped; + bool nearest_neighbor; }; struct TileQuadState { |