| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } | 496 } |
| 497 | 497 |
| 498 void RenderWidgetHostImpl::CopyFromBackingStore( | 498 void RenderWidgetHostImpl::CopyFromBackingStore( |
| 499 const gfx::Rect& src_subrect, | 499 const gfx::Rect& src_subrect, |
| 500 const gfx::Size& accelerated_dst_size, | 500 const gfx::Size& accelerated_dst_size, |
| 501 const base::Callback<void(bool)>& callback, | 501 const base::Callback<void(bool)>& callback, |
| 502 skia::PlatformCanvas* output) { | 502 skia::PlatformCanvas* output) { |
| 503 if (view_ && is_accelerated_compositing_active_) { | 503 if (view_ && is_accelerated_compositing_active_) { |
| 504 TRACE_EVENT0("browser", | 504 TRACE_EVENT0("browser", |
| 505 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); | 505 "RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface"); |
| 506 #if defined(USE_AURA) || defined(OS_LINUX) || defined(OS_MACOSX) | |
| 507 gfx::Rect copy_rect = src_subrect.IsEmpty() ? | 506 gfx::Rect copy_rect = src_subrect.IsEmpty() ? |
| 508 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; | 507 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; |
| 509 #else | |
| 510 // Just passes an empty rect to CopyFromCompositingSurface on non-Aura Win | |
| 511 // because copying a partial rectangle is not supported. | |
| 512 gfx::Rect copy_rect; | |
| 513 #endif | |
| 514 view_->CopyFromCompositingSurface(copy_rect, | 508 view_->CopyFromCompositingSurface(copy_rect, |
| 515 accelerated_dst_size, | 509 accelerated_dst_size, |
| 516 callback, | 510 callback, |
| 517 output); | 511 output); |
| 518 return; | 512 return; |
| 519 } | 513 } |
| 520 | 514 |
| 521 BackingStore* backing_store = GetBackingStore(false); | 515 BackingStore* backing_store = GetBackingStore(false); |
| 522 if (!backing_store) { | 516 if (!backing_store) { |
| 523 callback.Run(false); | 517 callback.Run(false); |
| (...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1940 // indicate that no callback is in progress (i.e. without this line | 1934 // indicate that no callback is in progress (i.e. without this line |
| 1941 // DelayedAutoResized will not get called again). | 1935 // DelayedAutoResized will not get called again). |
| 1942 new_auto_size_.SetSize(0, 0); | 1936 new_auto_size_.SetSize(0, 0); |
| 1943 if (!should_auto_resize_) | 1937 if (!should_auto_resize_) |
| 1944 return; | 1938 return; |
| 1945 | 1939 |
| 1946 OnRenderAutoResized(new_size); | 1940 OnRenderAutoResized(new_size); |
| 1947 } | 1941 } |
| 1948 | 1942 |
| 1949 } // namespace content | 1943 } // namespace content |
| OLD | NEW |