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_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 NOTREACHED() << "Need --composite-to-mailbox or --enable-delegated-renderer"; | 820 NOTREACHED() << "Need --composite-to-mailbox or --enable-delegated-renderer"; |
821 } | 821 } |
822 | 822 |
823 void RenderWidgetHostViewAndroid::BuffersSwapped( | 823 void RenderWidgetHostViewAndroid::BuffersSwapped( |
824 const gpu::Mailbox& mailbox, | 824 const gpu::Mailbox& mailbox, |
825 uint32_t output_surface_id, | 825 uint32_t output_surface_id, |
826 const base::Closure& ack_callback) { | 826 const base::Closure& ack_callback) { |
827 ImageTransportFactoryAndroid* factory = | 827 ImageTransportFactoryAndroid* factory = |
828 ImageTransportFactoryAndroid::GetInstance(); | 828 ImageTransportFactoryAndroid::GetInstance(); |
829 | 829 |
830 // TODO(sievers): When running the impl thread in the browser we | |
831 // need to delay the ACK until after commit and use more than a single | |
832 // texture. | |
833 DCHECK(!CompositorImpl::IsThreadingEnabled()); | |
834 | |
835 if (!texture_id_in_layer_) { | 830 if (!texture_id_in_layer_) { |
836 texture_id_in_layer_ = factory->CreateTexture(); | 831 texture_id_in_layer_ = factory->CreateTexture(); |
837 texture_layer_->SetIsDrawable(true); | 832 texture_layer_->SetIsDrawable(true); |
838 texture_layer_->SetContentsOpaque(true); | 833 texture_layer_->SetContentsOpaque(true); |
839 } | 834 } |
840 | 835 |
841 ImageTransportFactoryAndroid::GetInstance()->AcquireTexture( | 836 ImageTransportFactoryAndroid::GetInstance()->AcquireTexture( |
842 texture_id_in_layer_, mailbox.name); | 837 texture_id_in_layer_, mailbox.name); |
843 | 838 |
844 ResetClipping(); | 839 ResetClipping(); |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 // RenderWidgetHostView, public: | 1357 // RenderWidgetHostView, public: |
1363 | 1358 |
1364 // static | 1359 // static |
1365 RenderWidgetHostView* | 1360 RenderWidgetHostView* |
1366 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1361 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
1367 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1362 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
1368 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1363 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
1369 } | 1364 } |
1370 | 1365 |
1371 } // namespace content | 1366 } // namespace content |
OLD | NEW |