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

Unified Diff: mojo/tools/roll/cc_strip_video.patch

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « mojo/converters/surfaces/surfaces_type_converters.cc ('k') | net/base/address_tracker_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/roll/cc_strip_video.patch
diff --git a/mojo/tools/roll/cc_strip_video.patch b/mojo/tools/roll/cc_strip_video.patch
index 8098db6e458b406e98f2b36f8c605bca9e3561d2..4540a2a1ab736d422aaaf37210a69da767508b0d 100644
--- a/mojo/tools/roll/cc_strip_video.patch
+++ b/mojo/tools/roll/cc_strip_video.patch
@@ -1,5 +1,5 @@
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
-index 2ede4ac..eee115c 100644
+index 41f99e2..d6fd028 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -222,13 +222,6 @@ component("cc") {
@@ -34,30 +34,30 @@ index 2ede4ac..eee115c 100644
"test/failure_output_surface.cc",
"test/failure_output_surface.h",
"test/geometry_test_utils.cc",
-@@ -782,7 +771,6 @@ test("cc_unittests") {
- "layers/tiled_layer_unittest.cc",
- "layers/ui_resource_layer_impl_unittest.cc",
- "layers/ui_resource_layer_unittest.cc",
-- "layers/video_layer_impl_unittest.cc",
- "output/begin_frame_args_unittest.cc",
- "output/delegating_renderer_unittest.cc",
- "output/filter_operations_unittest.cc",
-@@ -814,7 +802,6 @@ test("cc_unittests") {
- "resources/texture_uploader_unittest.cc",
- "resources/tile_manager_unittest.cc",
- "resources/tile_priority_unittest.cc",
-- "resources/video_resource_updater_unittest.cc",
- "scheduler/begin_frame_source_unittest.cc",
- "scheduler/delay_based_time_source_unittest.cc",
- "scheduler/scheduler_state_machine_unittest.cc",
-@@ -843,7 +830,6 @@ test("cc_unittests") {
- "trees/layer_tree_host_unittest_picture.cc",
- "trees/layer_tree_host_unittest_proxy.cc",
- "trees/layer_tree_host_unittest_scroll.cc",
-- "trees/layer_tree_host_unittest_video.cc",
- "trees/layer_tree_impl_unittest.cc",
- "trees/occlusion_tracker_unittest.cc",
- "trees/occlusion_unittest.cc",
+@@ -783,7 +772,6 @@ if (!is_win || link_chrome_on_windows) {
+ "layers/tiled_layer_unittest.cc",
+ "layers/ui_resource_layer_impl_unittest.cc",
+ "layers/ui_resource_layer_unittest.cc",
+- "layers/video_layer_impl_unittest.cc",
+ "output/begin_frame_args_unittest.cc",
+ "output/delegating_renderer_unittest.cc",
+ "output/filter_operations_unittest.cc",
+@@ -815,7 +803,6 @@ if (!is_win || link_chrome_on_windows) {
+ "resources/texture_uploader_unittest.cc",
+ "resources/tile_manager_unittest.cc",
+ "resources/tile_priority_unittest.cc",
+- "resources/video_resource_updater_unittest.cc",
+ "scheduler/begin_frame_source_unittest.cc",
+ "scheduler/delay_based_time_source_unittest.cc",
+ "scheduler/scheduler_state_machine_unittest.cc",
+@@ -844,7 +831,6 @@ if (!is_win || link_chrome_on_windows) {
+ "trees/layer_tree_host_unittest_picture.cc",
+ "trees/layer_tree_host_unittest_proxy.cc",
+ "trees/layer_tree_host_unittest_scroll.cc",
+- "trees/layer_tree_host_unittest_video.cc",
+ "trees/layer_tree_impl_unittest.cc",
+ "trees/occlusion_tracker_unittest.cc",
+ "trees/occlusion_unittest.cc",
diff --git a/cc/layers/video_frame_provider.h b/cc/layers/video_frame_provider.h
deleted file mode 100644
index 784d951..0000000
@@ -128,10 +128,9 @@ index 784d951..0000000
-
-#endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
diff --git a/cc/layers/video_frame_provider_client_impl.cc b/cc/layers/video_frame_provider_client_impl.cc
-deleted file mode 100644
-index 50333c1..0000000
+index 2b12567..e69de29 100644
--- a/cc/layers/video_frame_provider_client_impl.cc
-+++ /dev/null
++++ b/cc/layers/video_frame_provider_client_impl.cc
@@ -1,95 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
@@ -139,7 +138,7 @@ index 50333c1..0000000
-
-#include "cc/layers/video_frame_provider_client_impl.h"
-
--#include "base/debug/trace_event.h"
+-#include "base/trace_event/trace_event.h"
-#include "cc/base/math_util.h"
-#include "cc/layers/video_layer_impl.h"
-#include "media/base/video_frame.h"
@@ -229,19 +228,19 @@ index 50333c1..0000000
-
-} // namespace cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
-index 9c856e8..e40a4fc 100644
+index 45d98b6..5a15efa 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -13,7 +13,6 @@
- #include "base/debug/trace_event.h"
#include "base/logging.h"
+ #include "base/trace_event/trace_event.h"
#include "cc/base/math_util.h"
-#include "cc/layers/video_layer_impl.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_metadata.h"
#include "cc/output/context_provider.h"
diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc
-index 08a4053..c7582fe 100644
+index d503cc4..c7582fe 100644
--- a/cc/output/renderer_pixeltest.cc
+++ b/cc/output/renderer_pixeltest.cc
@@ -12,7 +12,6 @@
@@ -252,7 +251,7 @@ index 08a4053..c7582fe 100644
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkMatrix.h"
-@@ -386,346 +385,6 @@ TEST_F(GLRendererPixelTest, NonPremultipliedTextureWithBackground) {
+@@ -386,453 +385,6 @@ TEST_F(GLRendererPixelTest, NonPremultipliedTextureWithBackground) {
FuzzyPixelOffByOneComparator(true)));
}
@@ -293,8 +292,9 @@ index 08a4053..c7582fe 100644
- v_row[j] = (v_value += 5);
- }
- }
+- uint8 alpha_value = is_transparent ? 0 : 128;
- CreateTestYUVVideoDrawQuad_FromVideoFrame(
-- shared_state, video_frame, is_transparent, tex_coord_rect, render_pass);
+- shared_state, video_frame, alpha_value, tex_coord_rect, render_pass);
- }
-
- void CreateTestYUVVideoDrawQuad_Solid(const SharedQuadState* shared_state,
@@ -326,14 +326,110 @@ index 08a4053..c7582fe 100644
- video_frame->stride(media::VideoFrame::kVPlane) *
- video_frame->rows(media::VideoFrame::kVPlane));
-
+- uint8 alpha_value = is_transparent ? 0 : 128;
+- CreateTestYUVVideoDrawQuad_FromVideoFrame(
+- shared_state, video_frame, alpha_value, tex_coord_rect, render_pass);
+- }
+-
+- void CreateEdgeBleedPass(media::VideoFrame::Format format,
+- RenderPassList* pass_list) {
+- gfx::Rect rect(200, 200);
+-
+- RenderPassId id(1, 1);
+- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+-
+- // Scale the video up so that bilinear filtering kicks in to sample more
+- // than just nearest neighbor would.
+- gfx::Transform scale_by_2;
+- scale_by_2.Scale(2.f, 2.f);
+- gfx::Rect half_rect(100, 100);
+- SharedQuadState* shared_state =
+- CreateTestSharedQuadState(scale_by_2, half_rect, pass.get());
+-
+- gfx::Size background_size(200, 200);
+- gfx::Rect green_rect(16, 20, 100, 100);
+- gfx::RectF tex_coord_rect(
+- static_cast<float>(green_rect.x()) / background_size.width(),
+- static_cast<float>(green_rect.y()) / background_size.height(),
+- static_cast<float>(green_rect.width()) / background_size.width(),
+- static_cast<float>(green_rect.height()) / background_size.height());
+-
+- // YUV of (149,43,21) should be green (0,255,0) in RGB.
+- // Create a video frame that has a non-green background rect, with a
+- // green sub-rectangle that should be the only thing displayed in
+- // the final image. Bleeding will appear on all four sides of the video
+- // if the tex coords are not clamped.
+- CreateTestYUVVideoDrawQuad_TwoColor(shared_state, format, false,
+- tex_coord_rect, background_size, 0, 0,
+- 0, green_rect, 149, 43, 21, pass.get());
+- pass_list->push_back(pass.Pass());
+- }
+-
+- // Creates a video frame of size background_size filled with yuv_background,
+- // and then draws a foreground rectangle in a different color on top of
+- // that. The foreground rectangle must have coordinates that are divisible
+- // by 2 because YUV is a block format.
+- void CreateTestYUVVideoDrawQuad_TwoColor(const SharedQuadState* shared_state,
+- media::VideoFrame::Format format,
+- bool is_transparent,
+- const gfx::RectF& tex_coord_rect,
+- const gfx::Size& background_size,
+- uint8 y_background,
+- uint8 u_background,
+- uint8 v_background,
+- const gfx::Rect& foreground_rect,
+- uint8 y_foreground,
+- uint8 u_foreground,
+- uint8 v_foreground,
+- RenderPass* render_pass) {
+- const gfx::Rect rect(background_size);
+-
+- scoped_refptr<media::VideoFrame> video_frame =
+- media::VideoFrame::CreateFrame(format, background_size, foreground_rect,
+- foreground_rect.size(),
+- base::TimeDelta());
+-
+- int planes[] = {media::VideoFrame::kYPlane,
+- media::VideoFrame::kUPlane,
+- media::VideoFrame::kVPlane};
+- uint8 yuv_background[] = {y_background, u_background, v_background};
+- uint8 yuv_foreground[] = {y_foreground, u_foreground, v_foreground};
+- int sample_size[] = {1, 2, 2};
+-
+- for (int i = 0; i < 3; ++i) {
+- memset(video_frame->data(planes[i]), yuv_background[i],
+- video_frame->stride(planes[i]) * video_frame->rows(planes[i]));
+- }
+-
+- for (int i = 0; i < 3; ++i) {
+- // Since yuv encoding uses block encoding, widths have to be divisible
+- // by the sample size in order for this function to behave properly.
+- DCHECK_EQ(foreground_rect.x() % sample_size[i], 0);
+- DCHECK_EQ(foreground_rect.y() % sample_size[i], 0);
+- DCHECK_EQ(foreground_rect.width() % sample_size[i], 0);
+- DCHECK_EQ(foreground_rect.height() % sample_size[i], 0);
+-
+- gfx::Rect sample_rect(foreground_rect.x() / sample_size[i],
+- foreground_rect.y() / sample_size[i],
+- foreground_rect.width() / sample_size[i],
+- foreground_rect.height() / sample_size[i]);
+- for (int y = sample_rect.y(); y < sample_rect.bottom(); ++y) {
+- for (int x = sample_rect.x(); x < sample_rect.right(); ++x) {
+- size_t offset = y * video_frame->stride(planes[i]) + x;
+- video_frame->data(planes[i])[offset] = yuv_foreground[i];
+- }
+- }
+- }
+-
+- uint8 alpha_value = 255;
- CreateTestYUVVideoDrawQuad_FromVideoFrame(
-- shared_state, video_frame, is_transparent, tex_coord_rect, render_pass);
+- shared_state, video_frame, alpha_value, tex_coord_rect, render_pass);
- }
-
- void CreateTestYUVVideoDrawQuad_FromVideoFrame(
- const SharedQuadState* shared_state,
- scoped_refptr<media::VideoFrame> video_frame,
-- bool is_transparent,
+- uint8 alpha_value,
- const gfx::RectF& tex_coord_rect,
- RenderPass* render_pass) {
- const bool with_alpha = (video_frame->format() == media::VideoFrame::YV12A);
@@ -341,12 +437,11 @@ index 08a4053..c7582fe 100644
- (video_frame->format() == media::VideoFrame::YV12J
- ? YUVVideoDrawQuad::REC_601_JPEG
- : YUVVideoDrawQuad::REC_601);
-- const gfx::Rect rect(this->device_viewport_size_);
+- const gfx::Rect rect(shared_state->content_bounds);
- const gfx::Rect opaque_rect(0, 0, 0, 0);
-
- if (with_alpha)
-- memset(video_frame->data(media::VideoFrame::kAPlane),
-- is_transparent ? 0 : 128,
+- memset(video_frame->data(media::VideoFrame::kAPlane), alpha_value,
- video_frame->stride(media::VideoFrame::kAPlane) *
- video_frame->rows(media::VideoFrame::kAPlane));
-
@@ -385,16 +480,9 @@ index 08a4053..c7582fe 100644
-
- YUVVideoDrawQuad* yuv_quad =
- render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
-- yuv_quad->SetNew(shared_state,
-- rect,
-- opaque_rect,
-- rect,
-- tex_coord_rect,
-- y_resource,
-- u_resource,
-- v_resource,
-- a_resource,
-- color_space);
+- yuv_quad->SetNew(shared_state, rect, opaque_rect, rect, tex_coord_rect,
+- video_frame->coded_size(), y_resource, u_resource,
+- v_resource, a_resource, color_space);
- }
-
- void SetUp() override {
@@ -512,6 +600,24 @@ index 08a4053..c7582fe 100644
- FuzzyPixelOffByOneComparator(true)));
-}
-
+-// Test that a YUV video doesn't bleed outside of its tex coords when the
+-// tex coord rect is only a partial subrectangle of the coded contents.
+-TEST_F(VideoGLRendererPixelTest, YUVEdgeBleed) {
+- RenderPassList pass_list;
+- CreateEdgeBleedPass(media::VideoFrame::YV12J, &pass_list);
+- EXPECT_TRUE(this->RunPixelTest(&pass_list,
+- base::FilePath(FILE_PATH_LITERAL("green.png")),
+- FuzzyPixelOffByOneComparator(true)));
+-}
+-
+-TEST_F(VideoGLRendererPixelTest, YUVAEdgeBleed) {
+- RenderPassList pass_list;
+- CreateEdgeBleedPass(media::VideoFrame::YV12A, &pass_list);
+- EXPECT_TRUE(this->RunPixelTest(&pass_list,
+- base::FilePath(FILE_PATH_LITERAL("green.png")),
+- FuzzyPixelOffByOneComparator(true)));
+-}
+-
-TEST_F(VideoGLRendererPixelTest, SimpleYUVJRectGrey) {
- gfx::Rect rect(this->device_viewport_size_);
-
@@ -600,7 +706,7 @@ index 08a4053..c7582fe 100644
gfx::Rect viewport_rect(this->device_viewport_size_);
diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h
-index e1c5410..edda34a 100644
+index 61f11a2..7ad0ba4 100644
--- a/cc/quads/yuv_video_draw_quad.h
+++ b/cc/quads/yuv_video_draw_quad.h
@@ -8,7 +8,6 @@
@@ -612,19 +718,19 @@ index e1c5410..edda34a 100644
namespace cc {
diff --git a/cc/resources/drawing_display_item.cc b/cc/resources/drawing_display_item.cc
-index e5610ca..473cb77 100644
+index 29cc2d3..351fade 100644
--- a/cc/resources/drawing_display_item.cc
+++ b/cc/resources/drawing_display_item.cc
-@@ -4,6 +4,7 @@
+@@ -6,6 +6,7 @@
- #include "cc/resources/drawing_display_item.h"
+ #include <string>
+#include "base/logging.h"
- #include "third_party/skia/include/core/SkCanvas.h"
- #include "third_party/skia/include/core/SkDrawPictureCallback.h"
- #include "third_party/skia/include/core/SkMatrix.h"
+ #include "base/strings/stringprintf.h"
+ #include "base/trace_event/trace_event_argument.h"
+ #include "cc/debug/picture_debug_util.h"
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
-index 6ac2f8c..7804f22 100644
+index cb33686..b016fff 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -27,7 +27,6 @@
@@ -667,7 +773,7 @@ index 6ac2f8c..7804f22 100644
}
LayerTreeSettings DefaultSettings() {
-@@ -5308,18 +5303,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
+@@ -5312,18 +5307,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
root_layer->SetBounds(gfx::Size(10, 10));
root_layer->SetHasRenderSurface(true);
@@ -686,7 +792,7 @@ index 6ac2f8c..7804f22 100644
scoped_ptr<IOSurfaceLayerImpl> io_surface_layer =
IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5);
io_surface_layer->SetBounds(gfx::Size(10, 10));
-@@ -6399,16 +6382,6 @@ TEST_F(LayerTreeHostImplTest,
+@@ -6403,16 +6386,6 @@ TEST_F(LayerTreeHostImplTest,
scoped_ptr<SolidColorLayerImpl> root_layer =
SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
@@ -704,7 +810,7 @@ index 6ac2f8c..7804f22 100644
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
-index 5299d70..1e10588 100644
+index a3c37ed..d4bfb6e 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -18,7 +18,6 @@
@@ -723,7 +829,7 @@ index 5299d70..1e10588 100644
#include "cc/test/geometry_test_utils.h"
#include "cc/test/impl_side_painting_settings.h"
#include "cc/test/layer_tree_test.h"
-@@ -4193,28 +4191,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest {
+@@ -4200,28 +4198,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest {
int num_draws_;
};
@@ -753,7 +859,7 @@ index 5299d70..1e10588 100644
// to the compositor thread, even though no resources are updated in
// response to that invalidation.
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
-index 681ae4e..cc4f28f 100644
+index 56e52ad..fb0c9c8 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -15,8 +15,6 @@
@@ -791,7 +897,7 @@ index 681ae4e..cc4f28f 100644
}
void LoseContext() {
-@@ -1041,43 +1034,6 @@ class LayerTreeHostContextTestDontUseLostResources
+@@ -1057,43 +1050,6 @@ class LayerTreeHostContextTestDontUseLostResources
layer_with_mask->SetMaskLayer(mask.get());
root->AddChild(layer_with_mask);
@@ -835,7 +941,7 @@ index 681ae4e..cc4f28f 100644
if (!delegating_renderer()) {
// TODO(danakj): IOSurface layer can not be transported. crbug.com/239335
scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create();
-@@ -1107,14 +1063,6 @@ class LayerTreeHostContextTestDontUseLostResources
+@@ -1123,14 +1079,6 @@ class LayerTreeHostContextTestDontUseLostResources
void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
LayerTreeHostContextTest::CommitCompleteOnThread(host_impl);
@@ -850,7 +956,7 @@ index 681ae4e..cc4f28f 100644
}
DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
-@@ -1163,14 +1111,6 @@ class LayerTreeHostContextTestDontUseLostResources
+@@ -1179,14 +1127,6 @@ class LayerTreeHostContextTestDontUseLostResources
scoped_refptr<DelegatedFrameResourceCollection>
delegated_resource_collection_;
scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_;
« no previous file with comments | « mojo/converters/surfaces/surfaces_type_converters.cc ('k') | net/base/address_tracker_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698