diff options
author | jbauman <jbauman@chromium.org> | 2015-06-04 17:57:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-05 00:58:11 +0000 |
commit | a783bb0e20cf75788763989ed75c60af3f172d80 (patch) | |
tree | ac2ee5e18a6000bceb182d0336ab53b1aa6dfc6a /cc | |
parent | 37ac5a8bc1a62cb1c86b1bdca792ebf2888296f2 (diff) | |
download | chromium_src-a783bb0e20cf75788763989ed75c60af3f172d80.zip chromium_src-a783bb0e20cf75788763989ed75c60af3f172d80.tar.gz chromium_src-a783bb0e20cf75788763989ed75c60af3f172d80.tar.bz2 |
Use Surfaces in Android webview
Replace the parent compositor with a Display. Use one Surface for the renderer contents and one Surface that handles transforming the inner Surface.
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1051763003
Cr-Commit-Position: refs/heads/master@{#332977}
Diffstat (limited to 'cc')
-rw-r--r-- | cc/surfaces/display.cc | 7 | ||||
-rw-r--r-- | cc/surfaces/display.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc index a9cef08..294dc5b 100644 --- a/cc/surfaces/display.cc +++ b/cc/surfaces/display.cc @@ -88,6 +88,10 @@ void Display::Resize(const gfx::Size& size) { scheduler_->EntireDisplayDamaged(current_surface_id_); } +void Display::SetExternalClip(const gfx::Rect& clip) { + external_clip_ = clip; +} + void Display::InitializeRenderer() { if (resource_provider_) return; @@ -180,7 +184,8 @@ bool Display::DrawAndSwap() { if (should_draw) { gfx::Rect device_viewport_rect = gfx::Rect(current_surface_size_); - gfx::Rect device_clip_rect = device_viewport_rect; + gfx::Rect device_clip_rect = + external_clip_.IsEmpty() ? device_viewport_rect : external_clip_; bool disable_picture_quad_image_filtering = false; renderer_->DecideRenderPassAllocationsForFrame( diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h index ab48181..b849b46 100644 --- a/cc/surfaces/display.h +++ b/cc/surfaces/display.h @@ -62,6 +62,7 @@ class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, // what scale this was rendered at. void SetSurfaceId(SurfaceId id, float device_scale_factor); void Resize(const gfx::Size& new_size); + void SetExternalClip(const gfx::Rect& clip); SurfaceId CurrentSurfaceId(); @@ -106,6 +107,7 @@ class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, gfx::Size current_surface_size_; float device_scale_factor_; bool swapped_since_resize_; + gfx::Rect external_clip_; scoped_ptr<OutputSurface> output_surface_; DisplayScheduler* scheduler_; scoped_ptr<ResourceProvider> resource_provider_; |