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/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2626 scoped_refptr<ui::Texture> old_texture = old_layer->external_texture(); | 2626 scoped_refptr<ui::Texture> old_texture = old_layer->external_texture(); |
2627 // The new_layer is the one that will be used by our Window, so that's the one | 2627 // The new_layer is the one that will be used by our Window, so that's the one |
2628 // that should keep our texture. old_layer will be returned to the | 2628 // that should keep our texture. old_layer will be returned to the |
2629 // RecreateLayer caller, and should have a copy. | 2629 // RecreateLayer caller, and should have a copy. |
2630 if (old_texture.get()) { | 2630 if (old_texture.get()) { |
2631 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 2631 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
2632 GLHelper* gl_helper = factory->GetGLHelper(); | 2632 GLHelper* gl_helper = factory->GetGLHelper(); |
2633 scoped_refptr<ui::Texture> new_texture; | 2633 scoped_refptr<ui::Texture> new_texture; |
2634 if (host_->is_accelerated_compositing_active() && | 2634 if (host_->is_accelerated_compositing_active() && |
2635 gl_helper && current_surface_.get()) { | 2635 gl_helper && current_surface_.get()) { |
2636 blink::WebGLId texture_id = | 2636 GLuint texture_id = |
2637 gl_helper->CopyTexture(current_surface_->PrepareTexture(), | 2637 gl_helper->CopyTexture(current_surface_->PrepareTexture(), |
2638 current_surface_->size()); | 2638 current_surface_->size()); |
2639 if (texture_id) { | 2639 if (texture_id) { |
2640 new_texture = factory->CreateOwnedTexture( | 2640 new_texture = factory->CreateOwnedTexture( |
2641 current_surface_->size(), | 2641 current_surface_->size(), |
2642 current_surface_->device_scale_factor(), texture_id); | 2642 current_surface_->device_scale_factor(), texture_id); |
2643 } | 2643 } |
2644 } | 2644 } |
2645 if (new_texture.get()) | 2645 if (new_texture.get()) |
2646 old_layer->SetExternalTexture(new_texture.get()); | 2646 old_layer->SetExternalTexture(new_texture.get()); |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3501 RenderWidgetHost* widget) { | 3501 RenderWidgetHost* widget) { |
3502 return new RenderWidgetHostViewAura(widget); | 3502 return new RenderWidgetHostViewAura(widget); |
3503 } | 3503 } |
3504 | 3504 |
3505 // static | 3505 // static |
3506 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3506 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3507 GetScreenInfoForWindow(results, NULL); | 3507 GetScreenInfoForWindow(results, NULL); |
3508 } | 3508 } |
3509 | 3509 |
3510 } // namespace content | 3510 } // namespace content |
OLD | NEW |