diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-26 12:30:17 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-26 12:30:17 +0000 |
commit | 9c2bd825bfd1ada103ac2b1a04480aa54a931dc8 (patch) | |
tree | 5187363d72d14fa474d4d2de210b8594fa3c24da /cc/test/layer_tree_pixel_test.h | |
parent | 10ff0502d87edeb89d63fefca8692ff40276d9a1 (diff) | |
download | chromium_src-9c2bd825bfd1ada103ac2b1a04480aa54a931dc8.zip chromium_src-9c2bd825bfd1ada103ac2b1a04480aa54a931dc8.tar.gz chromium_src-9c2bd825bfd1ada103ac2b1a04480aa54a931dc8.tar.bz2 |
cc: A pixel test for readbacks of layers with CanClipSelf == true.
TextureLayer is a self clipping layer, and this test verifies that
we are able to correctly copy the entire layer when it is outside
of the viewport.
Also includes a couple unit tests for TextureMailboxes on layers and
deleting the layer from the tree.
R=piman
BUG=263512
Review URL: https://chromiumcodereview.appspot.com/20048004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/layer_tree_pixel_test.h')
-rw-r--r-- | cc/test/layer_tree_pixel_test.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/cc/test/layer_tree_pixel_test.h b/cc/test/layer_tree_pixel_test.h index 72c14d5..9e830a9 100644 --- a/cc/test/layer_tree_pixel_test.h +++ b/cc/test/layer_tree_pixel_test.h @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <vector> + #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "cc/layers/solid_color_layer.h" #include "cc/test/layer_tree_test.h" #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_ @@ -18,6 +19,8 @@ class CopyOutputRequest; class CopyOutputResult; class LayerTreeHost; class PixelComparator; +class SolidColorLayer; +class TextureLayer; class TextureMailbox; class LayerTreePixelTest : public LayerTreeTest { @@ -38,6 +41,9 @@ class LayerTreePixelTest : public LayerTreeTest { virtual void BeginTest() OVERRIDE; virtual void SetupTree() OVERRIDE; virtual void AfterTest() OVERRIDE; + virtual void EndTest() OVERRIDE; + + void TryEndTest(); scoped_refptr<SolidColorLayer> CreateSolidColorLayer(gfx::Rect rect, SkColor color); @@ -46,6 +52,8 @@ class LayerTreePixelTest : public LayerTreeTest { SkColor color, int border_width, SkColor border_color); + scoped_refptr<TextureLayer> CreateTextureLayer(gfx::Rect rect, + const SkBitmap& bitmap); enum PixelTestType { GL_WITH_DEFAULT, @@ -67,6 +75,14 @@ class LayerTreePixelTest : public LayerTreeTest { gfx::Size size, const TextureMailbox& texture_mailbox); + TextureMailbox CopyBitmapToTextureMailboxAsTexture(const SkBitmap& bitmap); + + void ReleaseTextureMailbox( + scoped_ptr<WebKit::WebGraphicsContext3D> context3d, + uint32 texture, + uint32 sync_point, + bool lost_resource); + // Common CSS colors defined for tests to use. enum Colors { kCSSOrange = 0xffffa500, @@ -75,13 +91,13 @@ class LayerTreePixelTest : public LayerTreeTest { }; scoped_ptr<PixelComparator> pixel_comparator_; - - protected: PixelTestType test_type_; scoped_refptr<Layer> content_root_; Layer* readback_target_; base::FilePath ref_file_; scoped_ptr<SkBitmap> result_bitmap_; + std::vector<scoped_refptr<TextureLayer> > texture_layers_; + int pending_texture_mailbox_callbacks_; }; } // namespace cc |