| Index: ui/accelerated_widget_mac/ca_layer_tree_unittest_mac.mm
|
| diff --git a/gpu/ipc/service/ca_layer_tree_unittest_mac.mm b/ui/accelerated_widget_mac/ca_layer_tree_unittest_mac.mm
|
| similarity index 95%
|
| rename from gpu/ipc/service/ca_layer_tree_unittest_mac.mm
|
| rename to ui/accelerated_widget_mac/ca_layer_tree_unittest_mac.mm
|
| index e9dca6886a98920e9404a1eb8befbd194c897116..935e03bb9f47c1f898182bab8c0d898987af6494 100644
|
| --- a/gpu/ipc/service/ca_layer_tree_unittest_mac.mm
|
| +++ b/ui/accelerated_widget_mac/ca_layer_tree_unittest_mac.mm
|
| @@ -6,9 +6,9 @@
|
|
|
| #include "base/mac/sdk_forward_declarations.h"
|
| #include "gpu/GLES2/gl2extchromium.h"
|
| -#include "gpu/ipc/service/ca_layer_tree_mac.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "third_party/skia/include/core/SkColor.h"
|
| +#include "ui/accelerated_widget_mac/ca_layer_tree_mac.h"
|
| #include "ui/gfx/geometry/dip_util.h"
|
| #include "ui/gfx/mac/io_surface.h"
|
|
|
| @@ -40,7 +40,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| float scale_factor = 1.0f;
|
| bool result = false;
|
|
|
| - std::unique_ptr<CALayerTree> ca_layer_tree;
|
| + std::unique_ptr<ui::CALayerTree> ca_layer_tree;
|
| CALayer* root_layer = nil;
|
| CALayer* clip_and_sorting_layer = nil;
|
| CALayer* transform_layer = nil;
|
| @@ -48,7 +48,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
|
|
| // Validate the initial values.
|
| {
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -106,7 +106,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| // Update just the clip rect and re-commit.
|
| {
|
| clip_rect = gfx::Rect(4, 8, 16, 32);
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -147,7 +147,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| // Disable clipping and re-commit.
|
| {
|
| is_clipped = false;
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -185,7 +185,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| // Change the transform and re-commit.
|
| {
|
| transform.Translate(5, 5);
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -221,7 +221,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| // Change the edge antialiasing mask and commit.
|
| {
|
| edge_aa_mask = GL_CA_LAYER_EDGE_TOP_CHROMIUM;
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -255,7 +255,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
|
|
| // Change the contents and commit.
|
| {
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -291,7 +291,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| // Change the rect size.
|
| {
|
| rect = gfx::Rect(rect.origin(), gfx::Size(32, 16));
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -327,7 +327,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| // Change the rect position.
|
| {
|
| rect = gfx::Rect(gfx::Point(16, 4), rect.size());
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -363,7 +363,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| // Change the opacity.
|
| {
|
| opacity = 1.0f;
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -398,7 +398,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| // Add the clipping and IOSurface contents back.
|
| {
|
| is_clipped = true;
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -434,7 +434,7 @@ TEST_F(CALayerTreeTest, PropertyUpdates) {
|
| // Change the scale factor. This should result in a new tree being created.
|
| {
|
| scale_factor = 2.0f;
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| clip_rect,
|
| @@ -528,7 +528,7 @@ TEST_F(CALayerTreeTest, SplitSortingContextZero) {
|
| transforms[4].Translate(10, 10);
|
|
|
| // Schedule and commit the layers.
|
| - std::unique_ptr<CALayerTree> ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> ca_layer_tree(new ui::CALayerTree);
|
| for (size_t i = 0; i < 5; ++i) {
|
| bool result = ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| @@ -613,7 +613,7 @@ TEST_F(CALayerTreeTest, SortingContexts) {
|
| }
|
|
|
| // Schedule and commit the layers.
|
| - std::unique_ptr<CALayerTree> ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> ca_layer_tree(new ui::CALayerTree);
|
| for (size_t i = 0; i < 3; ++i) {
|
| bool result = ca_layer_tree->ScheduleCALayer(
|
| is_clipped,
|
| @@ -683,7 +683,7 @@ TEST_F(CALayerTreeTest, SortingContextMustHaveConsistentClip) {
|
| gfx::Rect(0, 0, 16, 16)
|
| };
|
|
|
| - std::unique_ptr<CALayerTree> ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> ca_layer_tree(new ui::CALayerTree);
|
| // First send the various clip parameters to sorting context zero. This is
|
| // legitimate.
|
| for (size_t i = 0; i < 3; ++i) {
|
| @@ -755,7 +755,7 @@ TEST_F(CALayerTreeTest, AVLayer) {
|
| float scale_factor = 1.0f;
|
| bool result = false;
|
|
|
| - std::unique_ptr<CALayerTree> ca_layer_tree;
|
| + std::unique_ptr<ui::CALayerTree> ca_layer_tree;
|
| CALayer* root_layer = nil;
|
| CALayer* clip_and_sorting_layer = nil;
|
| CALayer* transform_layer = nil;
|
| @@ -765,7 +765,7 @@ TEST_F(CALayerTreeTest, AVLayer) {
|
|
|
| // Validate the initial values.
|
| {
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped, clip_rect, sorting_context_id, transform, io_surface,
|
| contents_rect, rect, background_color, edge_aa_mask, opacity);
|
| @@ -794,7 +794,7 @@ TEST_F(CALayerTreeTest, AVLayer) {
|
|
|
| // Pass another frame.
|
| {
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped, clip_rect, sorting_context_id, transform, io_surface,
|
| contents_rect, rect, background_color, edge_aa_mask, opacity);
|
| @@ -825,7 +825,7 @@ TEST_F(CALayerTreeTest, AVLayer) {
|
| // Pass a frame that is clipped.
|
| contents_rect = gfx::RectF(0, 0, 1, 0.9);
|
| {
|
| - std::unique_ptr<CALayerTree> new_ca_layer_tree(new CALayerTree);
|
| + std::unique_ptr<ui::CALayerTree> new_ca_layer_tree(new ui::CALayerTree);
|
| result = new_ca_layer_tree->ScheduleCALayer(
|
| is_clipped, clip_rect, sorting_context_id, transform, io_surface,
|
| contents_rect, rect, background_color, edge_aa_mask, opacity);
|
|
|