| 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_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 unsigned char* addr = static_cast<unsigned char*>( | 503 unsigned char* addr = static_cast<unsigned char*>( |
| 504 output->getTopDevice()->accessBitmap(true).getPixels()); | 504 output->getTopDevice()->accessBitmap(true).getPixels()); |
| 505 scoped_callback_runner.Release(); | 505 scoped_callback_runner.Release(); |
| 506 // Wrap the callback with an internal handler so that we can inject our | 506 // Wrap the callback with an internal handler so that we can inject our |
| 507 // own completion handlers (where we can call AdjustSurfaceProtection). | 507 // own completion handlers (where we can call AdjustSurfaceProtection). |
| 508 base::Callback<void(bool)> wrapper_callback = base::Bind( | 508 base::Callback<void(bool)> wrapper_callback = base::Bind( |
| 509 &RenderWidgetHostViewAura::CopyFromCompositingSurfaceFinished, | 509 &RenderWidgetHostViewAura::CopyFromCompositingSurfaceFinished, |
| 510 AsWeakPtr(), | 510 AsWeakPtr(), |
| 511 callback); | 511 callback); |
| 512 pending_thumbnail_tasks_.push_back(callback); | 512 pending_thumbnail_tasks_.push_back(callback); |
| 513 gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(this, src_subrect); | 513 |
| 514 // Convert |src_subrect| from the views coordinate (upper-left origin) into |
| 515 // the OpenGL coordinate (lower-left origin). |
| 516 gfx::Rect src_subrect_in_gl = src_subrect; |
| 517 src_subrect_in_gl.set_y(GetViewBounds().height() - src_subrect.bottom()); |
| 518 |
| 519 gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(this, src_subrect_in_gl); |
| 514 gl_helper->CopyTextureTo(container->texture_id(), | 520 gl_helper->CopyTextureTo(container->texture_id(), |
| 515 container->size(), | 521 container->size(), |
| 516 src_subrect_in_pixel, | 522 src_subrect_in_pixel, |
| 517 dst_size_in_pixel, | 523 dst_size_in_pixel, |
| 518 addr, | 524 addr, |
| 519 wrapper_callback); | 525 wrapper_callback); |
| 520 } | 526 } |
| 521 | 527 |
| 522 void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() { | 528 void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() { |
| 523 // Delay processing the state change until we either get a software frame if | 529 // Delay processing the state change until we either get a software frame if |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 RenderWidgetHost* widget) { | 1648 RenderWidgetHost* widget) { |
| 1643 return new RenderWidgetHostViewAura(widget); | 1649 return new RenderWidgetHostViewAura(widget); |
| 1644 } | 1650 } |
| 1645 | 1651 |
| 1646 // static | 1652 // static |
| 1647 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 1653 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 1648 GetScreenInfoForWindow(results, NULL); | 1654 GetScreenInfoForWindow(results, NULL); |
| 1649 } | 1655 } |
| 1650 | 1656 |
| 1651 } // namespace content | 1657 } // namespace content |
| OLD | NEW |