Skip to content

Commit

Permalink
Remove the cc/quads/ directory.
Browse files Browse the repository at this point in the history
The RenderPass unit tests move to viz/common. The nine patch generator
is used from layers making nine patch quads, so it moves to cc/layers/
and the DrawPolygon was actually part of the BSP rendering in
DirectRenderer so it moves to cc/output/.

R=vmpstr@chromium.org
NOTRY=true

Bug: 722935
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ic2fabf8f112a3a9934b8716cdbae5823a3b91775
Reviewed-on: https://chromium-review.googlesource.com/668664
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502878}
  • Loading branch information
danakj authored and Commit Bot committed Sep 19, 2017
1 parent 5d2f94c commit 83d0eb4
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 105 deletions.
13 changes: 6 additions & 7 deletions cc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ cc_component("cc") {
"layers/layer_position_constraint.h",
"layers/layer_sticky_position_constraint.cc",
"layers/layer_sticky_position_constraint.h",
"layers/nine_patch_generator.cc",
"layers/nine_patch_generator.h",
"layers/nine_patch_layer.cc",
"layers/nine_patch_layer.h",
"layers/nine_patch_layer_impl.cc",
Expand Down Expand Up @@ -146,6 +148,8 @@ cc_component("cc") {
"output/dc_layer_overlay.h",
"output/direct_renderer.cc",
"output/direct_renderer.h",
"output/draw_polygon.cc",
"output/draw_polygon.h",
"output/latency_info_swap_promise.cc",
"output/latency_info_swap_promise.h",
"output/layer_tree_frame_sink.cc",
Expand Down Expand Up @@ -176,10 +180,6 @@ cc_component("cc") {
"output/software_renderer.cc",
"output/software_renderer.h",
"output/swap_promise.h",
"quads/draw_polygon.cc",
"quads/draw_polygon.h",
"quads/nine_patch_generator.cc",
"quads/nine_patch_generator.h",
"raster/bitmap_raster_buffer_provider.cc",
"raster/bitmap_raster_buffer_provider.h",
"raster/gpu_raster_buffer_provider.cc",
Expand Down Expand Up @@ -616,6 +616,7 @@ cc_test("cc_unittests") {
"layers/layer_list_iterator_unittest.cc",
"layers/layer_position_constraint_unittest.cc",
"layers/layer_unittest.cc",
"layers/nine_patch_generator_unittest.cc",
"layers/nine_patch_layer_impl_unittest.cc",
"layers/nine_patch_layer_unittest.cc",
"layers/painted_scrollbar_layer_impl_unittest.cc",
Expand All @@ -641,6 +642,7 @@ cc_test("cc_unittests") {
"layers/viewport_unittest.cc",
"output/bsp_tree_unittest.cc",
"output/context_cache_controller_unittest.cc",
"output/draw_polygon_unittest.cc",
"output/layer_tree_frame_sink_unittest.cc",
"output/overlay_unittest.cc",
"output/renderer_pixeltest.cc",
Expand All @@ -650,9 +652,6 @@ cc_test("cc_unittests") {
"paint/paint_image_unittest.cc",
"paint/paint_op_buffer_unittest.cc",
"paint/solid_color_analyzer_unittest.cc",
"quads/draw_polygon_unittest.cc",
"quads/nine_patch_generator_unittest.cc",
"quads/render_pass_unittest.cc",
"raster/playback_image_provider_unittest.cc",
"raster/raster_buffer_provider_unittest.cc",
"raster/raster_source_unittest.cc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/quads/nine_patch_generator.h"
#include "cc/layers/nine_patch_generator.h"

#include "cc/trees/layer_tree_impl.h"
#include "components/viz/common/quads/render_pass.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_QUADS_NINE_PATCH_GENERATOR_H_
#define CC_QUADS_NINE_PATCH_GENERATOR_H_
#ifndef CC_LAYERS_NINE_PATCH_GENERATOR_H_
#define CC_LAYERS_NINE_PATCH_GENERATOR_H_

#include <string>
#include <vector>
Expand All @@ -23,7 +23,7 @@ class DictionaryValue;
namespace viz {
class RenderPass;
class SharedQuadState;
}
} // namespace viz

namespace cc {
class LayerImpl;
Expand Down Expand Up @@ -129,4 +129,4 @@ class CC_EXPORT NinePatchGenerator {

} // namespace cc

#endif // CC_QUADS_NINE_PATCH_GENERATOR_H_
#endif // CC_LAYERS_NINE_PATCH_GENERATOR_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/quads/nine_patch_generator.h"
#include "cc/layers/nine_patch_generator.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/layers/nine_patch_layer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include "base/memory/ptr_util.h"
#include "cc/cc_export.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/nine_patch_generator.h"
#include "cc/layers/ui_resource_layer_impl.h"
#include "cc/quads/nine_patch_generator.h"
#include "cc/resources/resource_provider.h"
#include "cc/resources/ui_resource_client.h"
#include "ui/gfx/geometry/rect.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/layers/painted_overlay_scrollbar_layer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "base/macros.h"
#include "cc/cc_export.h"
#include "cc/input/scrollbar.h"
#include "cc/layers/nine_patch_generator.h"
#include "cc/layers/scrollbar_layer_impl_base.h"
#include "cc/quads/nine_patch_generator.h"
#include "cc/resources/ui_resource_client.h"

namespace cc {
Expand Down
2 changes: 1 addition & 1 deletion cc/output/bsp_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/memory/ptr_util.h"
#include "cc/base/container_util.h"
#include "cc/output/bsp_compare_result.h"
#include "cc/quads/draw_polygon.h"
#include "cc/output/draw_polygon.h"

namespace cc {

Expand Down
2 changes: 1 addition & 1 deletion cc/output/bsp_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <vector>

#include "cc/output/bsp_compare_result.h"
#include "cc/quads/draw_polygon.h"
#include "cc/output/draw_polygon.h"

namespace cc {

Expand Down
2 changes: 1 addition & 1 deletion cc/output/bsp_tree_perftest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "cc/base/lap_timer.h"
#include "cc/layers/layer.h"
#include "cc/output/bsp_tree.h"
#include "cc/quads/draw_polygon.h"
#include "cc/output/draw_polygon.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/layer_tree_json_parser.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/output/bsp_tree_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "base/macros.h"
#include "cc/output/bsp_walk_action.h"
#include "cc/quads/draw_polygon.h"
#include "cc/output/draw_polygon.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace cc {
Expand Down
2 changes: 1 addition & 1 deletion cc/output/bsp_walk_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <vector>

#include "cc/output/direct_renderer.h"
#include "cc/quads/draw_polygon.h"
#include "cc/output/draw_polygon.h"
#include "components/viz/common/quads/draw_quad.h"

namespace cc {
Expand Down
2 changes: 1 addition & 1 deletion cc/output/bsp_walk_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <vector>

#include "cc/output/direct_renderer.h"
#include "cc/quads/draw_polygon.h"
#include "cc/output/draw_polygon.h"

namespace cc {

Expand Down
17 changes: 7 additions & 10 deletions cc/quads/draw_polygon.cc → cc/output/draw_polygon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/quads/draw_polygon.h"
#include "cc/output/draw_polygon.h"

#include <stddef.h>

#include <vector>

#include "base/memory/ptr_util.h"
#include "build/build_config.h"
#include "components/viz/common/quads/draw_quad.h"

namespace {
Expand All @@ -31,8 +31,7 @@ void PointInterpolate(const gfx::Point3F& from,

namespace cc {

DrawPolygon::DrawPolygon() {
}
DrawPolygon::DrawPolygon() {}

DrawPolygon::DrawPolygon(const viz::DrawQuad* original,
const std::vector<gfx::Point3F>& in_points,
Expand Down Expand Up @@ -71,17 +70,16 @@ DrawPolygon::DrawPolygon(const viz::DrawQuad* original_ref,
// crossing w = 0. At this point, in the constructor, we know that we're
// working with a quad, so we can reuse the MathUtil::MapClippedQuad3d
// function instead of writing a generic polygon version of it.
MathUtil::MapClippedQuad3d(
transform, send_quad, points, &num_vertices_in_clipped_quad);
MathUtil::MapClippedQuad3d(transform, send_quad, points,
&num_vertices_in_clipped_quad);
for (int i = 0; i < num_vertices_in_clipped_quad; i++) {
points_.push_back(points[i]);
}
transform.TransformVector(&normal_);
ConstructNormal();
}

DrawPolygon::~DrawPolygon() {
}
DrawPolygon::~DrawPolygon() {}

std::unique_ptr<DrawPolygon> DrawPolygon::CreateCopy() {
std::unique_ptr<DrawPolygon> new_polygon(new DrawPolygon());
Expand Down Expand Up @@ -340,8 +338,7 @@ void DrawPolygon::ToQuads2D(std::vector<gfx::QuadF>* quads) const {
op2 = op1;
}
quads->push_back(
gfx::QuadF(first,
gfx::PointF(points_[offset].x(), points_[offset].y()),
gfx::QuadF(first, gfx::PointF(points_[offset].x(), points_[offset].y()),
gfx::PointF(points_[op1].x(), points_[op1].y()),
gfx::PointF(points_[op2].x(), points_[op2].y())));
offset = op2;
Expand Down
6 changes: 3 additions & 3 deletions cc/quads/draw_polygon.h → cc/output/draw_polygon.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_QUADS_DRAW_POLYGON_H_
#define CC_QUADS_DRAW_POLYGON_H_
#ifndef CC_OUTPUT_DRAW_POLYGON_H_
#define CC_OUTPUT_DRAW_POLYGON_H_

#include <vector>

Expand Down Expand Up @@ -86,4 +86,4 @@ class CC_EXPORT DrawPolygon {

} // namespace cc

#endif // CC_QUADS_DRAW_POLYGON_H_
#endif // CC_OUTPUT_DRAW_POLYGON_H_
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#include "base/memory/ptr_util.h"
#include "base/numerics/math_constants.h"
#include "base/stl_util.h"
#include "build/build_config.h"
#include "cc/output/bsp_compare_result.h"
#include "cc/quads/draw_polygon.h"
#include "cc/output/draw_polygon.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/transform.h"

Expand Down
1 change: 1 addition & 0 deletions components/viz/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ viz_source_set("unit_tests") {
"frame_sinks/delay_based_time_source_unittest.cc",
"gl_helper_unittest.cc",
"quads/draw_quad_unittest.cc",
"quads/render_pass_unittest.cc",
"resources/buffer_to_texture_target_map_unittest.cc",
"resources/platform_color_unittest.cc",
"surfaces/surface_sequence_generator_unittest.cc",
Expand Down
Loading

0 comments on commit 83d0eb4

Please sign in to comment.