summaryrefslogtreecommitdiffstats
path: root/cc/quads/render_pass_unittest.cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-18 18:24:24 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-18 18:24:24 +0000
commit6389458704504692b4fdf2e5869ff4dbf1b66b5c (patch)
tree25b696fd0597fe55ad7fa2a1c1554007071761c9 /cc/quads/render_pass_unittest.cc
parentcfa8f9d79c87ea20f0162af76acedc2a7e6cb5ab (diff)
downloadchromium_src-6389458704504692b4fdf2e5869ff4dbf1b66b5c.zip
chromium_src-6389458704504692b4fdf2e5869ff4dbf1b66b5c.tar.gz
chromium_src-6389458704504692b4fdf2e5869ff4dbf1b66b5c.tar.bz2
cc: Add ability to request copy of compositor output as a texture.
This adds the ability to request the compositor's output as a texture instead of requiring a readback to a SkBitmap on the cpu. This will allow the embedder to make a request for a texture and then scale or sample it without reading back the entire full-sized texture to the cpu. To readback successive frames will require constant commits at this time, but the mechanism could be extended to allow one main thread request to result in multiple copy result callbacks. This is tested by the LayerTreeHostPixelTestReadback tests. I've added a viewport offset, and surface expansion size, to all of the LayerTreeTest based pixel tests. This exposed a bug in the math for background filters when a viewport offset/surface expansion size is present, so this is fixed as well to make the tests pass (one line in GLRenderer::ApplyBackgroundFilters). Instead of having the CopyOutputRequest return a SkBitmap directly, or return a TextureMailbox directly (sometimes backed by a software bitmap), I've added a CopyOutputResult class to return with a reply from the compositor. This reply may be a texture (via a TextureMailbox) or a bitmap (via an SkBitmap). The embedder should be able to handle either one when it makes a request, unless its request forces a software-bitmap reply. The tests verify GLRenderer+general request, GLRenderer+forced software request, and SoftwareRenderer+general request. Adding the offset/expansion to the viewport/surface causes the offaxis background blur pixel test to become off-by-one in 5 pixels, requiring a rebaseline. R=enne, jamesr, piman BUG=242571 Review URL: https://chromiumcodereview.appspot.com/17018002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/quads/render_pass_unittest.cc')
-rw-r--r--cc/quads/render_pass_unittest.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/cc/quads/render_pass_unittest.cc b/cc/quads/render_pass_unittest.cc
index 1ab41e8..fdeb4f0 100644
--- a/cc/quads/render_pass_unittest.cc
+++ b/cc/quads/render_pass_unittest.cc
@@ -50,8 +50,7 @@ TEST(RenderPassTest, CopyShouldBeIdenticalExceptIdAndQuads) {
transform_to_root,
has_transparent_background,
has_occlusion_from_outside_target_surface);
- pass->copy_requests.push_back(CopyOutputRequest::CreateBitmapRequest(
- CopyOutputRequest::CopyAsBitmapCallback()));
+ pass->copy_requests.push_back(CopyOutputRequest::CreateEmptyRequest());
// Stick a quad in the pass, this should not get copied.
scoped_ptr<SharedQuadState> shared_state = SharedQuadState::Create();