summaryrefslogtreecommitdiffstats
path: root/cc/render_pass_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/render_pass_unittest.cc')
-rw-r--r--cc/render_pass_unittest.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/cc/render_pass_unittest.cc b/cc/render_pass_unittest.cc
index 42e6c2e..acd5ad3 100644
--- a/cc/render_pass_unittest.cc
+++ b/cc/render_pass_unittest.cc
@@ -8,6 +8,7 @@
#include "CCCheckerboardDrawQuad.h"
#include "cc/test/geometry_test_utils.h"
+#include "cc/test/render_pass_test_common.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/effects/SkBlurImageFilter.h"
#include <public/WebFilterOperations.h>
@@ -16,17 +17,12 @@
using WebKit::WebFilterOperation;
using WebKit::WebFilterOperations;
using WebKit::WebTransformationMatrix;
+using WebKitTests::TestRenderPass;
using namespace cc;
namespace {
-class TestRenderPass : public RenderPass {
-public:
- QuadList& quadList() { return m_quadList; }
- SharedQuadStateList& sharedQuadStateList() { return m_sharedQuadStateList; }
-};
-
struct RenderPassSize {
// If you add a new field to this class, make sure to add it to the copy() tests.
RenderPass::Id m_id;
@@ -48,7 +44,7 @@ TEST(RenderPassTest, copyShouldBeIdenticalExceptIdAndQuads)
gfx::Rect outputRect(45, 22, 120, 13);
WebTransformationMatrix transformToRoot(1, 0.5, 0.5, -0.5, -1, 0);
- scoped_ptr<RenderPass> pass = RenderPass::create(id, outputRect, transformToRoot);
+ scoped_ptr<TestRenderPass> pass = TestRenderPass::create(id, outputRect, transformToRoot);
gfx::Rect damageRect(56, 123, 19, 43);
bool hasTransparentBackground = true;
@@ -68,9 +64,8 @@ TEST(RenderPassTest, copyShouldBeIdenticalExceptIdAndQuads)
pass->setFilter(filter);
// Stick a quad in the pass, this should not get copied.
- TestRenderPass* testPass = static_cast<TestRenderPass*>(pass.get());
- testPass->sharedQuadStateList().append(SharedQuadState::create(WebTransformationMatrix(), gfx::Rect(), gfx::Rect(), 1, false));
- testPass->quadList().append(CheckerboardDrawQuad::create(testPass->sharedQuadStateList().last(), gfx::Rect(), SkColor()).PassAs<DrawQuad>());
+ pass->sharedQuadStateList().append(SharedQuadState::create(WebTransformationMatrix(), gfx::Rect(), gfx::Rect(), 1, false));
+ pass->quadList().append(CheckerboardDrawQuad::create(pass->sharedQuadStateList().last(), gfx::Rect(), SkColor()).PassAs<DrawQuad>());
RenderPass::Id newId(63, 4);