| Index: components/display_compositor/gl_helper_benchmark.cc
|
| diff --git a/content/browser/compositor/gl_helper_benchmark.cc b/components/display_compositor/gl_helper_benchmark.cc
|
| similarity index 91%
|
| rename from content/browser/compositor/gl_helper_benchmark.cc
|
| rename to components/display_compositor/gl_helper_benchmark.cc
|
| index ac914423d0a707cab9146e278fe7411fc44d2159..6bca10a0bbf181fc889c818ae1a6988dd3c6e389 100644
|
| --- a/content/browser/compositor/gl_helper_benchmark.cc
|
| +++ b/components/display_compositor/gl_helper_benchmark.cc
|
| @@ -24,8 +24,8 @@
|
| #include "base/macros.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/time/time.h"
|
| -#include "content/browser/compositor/gl_helper.h"
|
| -#include "content/browser/compositor/gl_helper_scaling.h"
|
| +#include "components/display_compositor/gl_helper.h"
|
| +#include "components/display_compositor/gl_helper_scaling.h"
|
| #include "gpu/command_buffer/client/gl_in_process_context.h"
|
| #include "gpu/command_buffer/client/gles2_implementation.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -34,18 +34,22 @@
|
| #include "ui/gfx/codec/png_codec.h"
|
| #include "ui/gl/gl_surface.h"
|
|
|
| -namespace content {
|
| +namespace display_compositor {
|
|
|
| -content::GLHelper::ScalerQuality kQualities[] = {
|
| - content::GLHelper::SCALER_QUALITY_BEST,
|
| - content::GLHelper::SCALER_QUALITY_GOOD,
|
| - content::GLHelper::SCALER_QUALITY_FAST,
|
| +namespace {
|
| +
|
| +display_compositor::GLHelper::ScalerQuality kQualities[] = {
|
| + display_compositor::GLHelper::SCALER_QUALITY_BEST,
|
| + display_compositor::GLHelper::SCALER_QUALITY_GOOD,
|
| + display_compositor::GLHelper::SCALER_QUALITY_FAST,
|
| };
|
|
|
| const char* const kQualityNames[] = {
|
| "best", "good", "fast",
|
| };
|
|
|
| +} // namespace
|
| +
|
| class GLHelperTest : public testing::Test {
|
| protected:
|
| void SetUp() override {
|
| @@ -74,8 +78,9 @@ class GLHelperTest : public testing::Test {
|
| gl_ = context_->GetImplementation();
|
| gpu::ContextSupport* support = context_->GetImplementation();
|
|
|
| - helper_.reset(new content::GLHelper(gl_, support));
|
| - helper_scaling_.reset(new content::GLHelperScaling(gl_, helper_.get()));
|
| + helper_.reset(new display_compositor::GLHelper(gl_, support));
|
| + helper_scaling_.reset(
|
| + new display_compositor::GLHelperScaling(gl_, helper_.get()));
|
| }
|
|
|
| void TearDown() override {
|
| @@ -112,8 +117,8 @@ class GLHelperTest : public testing::Test {
|
|
|
| std::unique_ptr<gpu::GLInProcessContext> context_;
|
| gpu::gles2::GLES2Interface* gl_;
|
| - std::unique_ptr<content::GLHelper> helper_;
|
| - std::unique_ptr<content::GLHelperScaling> helper_scaling_;
|
| + std::unique_ptr<display_compositor::GLHelper> helper_;
|
| + std::unique_ptr<display_compositor::GLHelperScaling> helper_scaling_;
|
| std::deque<GLHelperScaling::ScaleOp> x_ops_, y_ops_;
|
| };
|
|
|
| @@ -151,7 +156,7 @@ TEST_F(GLHelperTest, ScaleBenchmark) {
|
| input.getPixels());
|
|
|
| gfx::Rect src_subrect(0, 0, src_size.width(), src_size.height());
|
| - std::unique_ptr<content::GLHelper::ScalerInterface> scaler(
|
| + std::unique_ptr<display_compositor::GLHelper::ScalerInterface> scaler(
|
| helper_->CreateScaler(kQualities[q], src_size, src_subrect,
|
| dst_size, false, false));
|
| // Scale once beforehand before we start measuring.
|
| @@ -244,4 +249,4 @@ TEST_F(GLHelperTest, DISABLED_ScaleTestImage) {
|
| gl_->DeleteFramebuffers(1, &framebuffer);
|
| }
|
|
|
| -} // namespace content
|
| +} // namespace display_compositor
|
|
|