| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/test/pixel_test_output_surface.h" | 5 #include "cc/test/pixel_test_output_surface.h" |
| 6 | 6 |
| 7 #include "cc/output/output_surface_client.h" | 7 #include "cc/output/output_surface_client.h" |
| 8 #include "ui/gfx/transform.h" | 8 #include "ui/gfx/transform.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| 11 | 11 |
| 12 void PixelTestOutputSurface::Reshape(gfx::Size size, float scale_factor) { | 12 void PixelTestOutputSurface::Reshape(gfx::Size size, float scale_factor) { |
| 13 gfx::Size expanded_size(size.width() + surface_expansion_size_.width(), | 13 gfx::Size expanded_size(size.width() + surface_expansion_size_.width(), |
| 14 size.height() + surface_expansion_size_.height()); | 14 size.height() + surface_expansion_size_.height()); |
| 15 OutputSurface::Reshape(expanded_size, scale_factor); | 15 OutputSurface::Reshape(expanded_size, scale_factor); |
| 16 | 16 |
| 17 gfx::Rect offset_viewport = gfx::Rect(size) + viewport_offset_; | 17 gfx::Rect offset_viewport = gfx::Rect(size) + viewport_offset_; |
| 18 SetExternalDrawConstraints(gfx::Transform(), offset_viewport); | 18 gfx::Rect offset_clip = device_clip_.IsEmpty() |
| 19 ? offset_viewport |
| 20 : device_clip_ + viewport_offset_; |
| 21 SetExternalDrawConstraints( |
| 22 gfx::Transform(), offset_viewport, offset_clip, true); |
| 19 } | 23 } |
| 20 | 24 |
| 21 } // namespace cc | 25 } // namespace cc |
| OLD | NEW |