| Index: content/browser/renderer_host/render_widget_host_view_android.cc
|
| ===================================================================
|
| --- content/browser/renderer_host/render_widget_host_view_android.cc (revision 171661)
|
| +++ content/browser/renderer_host/render_widget_host_view_android.cc (working copy)
|
| @@ -56,8 +56,7 @@
|
| content_view_core_(NULL),
|
| ime_adapter_android_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
|
| cached_background_color_(SK_ColorWHITE),
|
| - texture_id_in_layer_(0),
|
| - current_buffer_id_(0) {
|
| + texture_id_in_layer_(0) {
|
| if (CompositorImpl::UsesDirectGL()) {
|
| surface_texture_transport_.reset(new SurfaceTextureTransportClient());
|
| layer_ = surface_texture_transport_->Initialize();
|
| @@ -79,10 +78,6 @@
|
| ImageTransportFactoryAndroid::GetInstance()->DestroySharedSurfaceHandle(
|
| shared_surface_);
|
| }
|
| - if (texture_id_in_layer_) {
|
| - ImageTransportFactoryAndroid::GetInstance()->DeleteTexture(
|
| - texture_id_in_layer_);
|
| - }
|
| }
|
|
|
| void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) {
|
| @@ -393,42 +388,19 @@
|
| void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped(
|
| const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
|
| int gpu_host_id) {
|
| - ImageTransportFactoryAndroid* factory =
|
| - ImageTransportFactoryAndroid::GetInstance();
|
| + texture_layer_->setTextureId(params.surface_handle);
|
| + DCHECK(texture_layer_ == layer_);
|
| + layer_->setBounds(params.size);
|
| + texture_id_in_layer_ = params.surface_handle;
|
| + texture_size_in_layer_ = params.size;
|
|
|
| // TODO(sievers): When running the impl thread in the browser we
|
| - // need to delay the ACK until after commit and use more than a single
|
| - // texture.
|
| + // need to delay the ACK until after commit.
|
| DCHECK(!CompositorImpl::IsThreadingEnabled());
|
| -
|
| - uint64 previous_buffer = current_buffer_id_;
|
| - if (previous_buffer && texture_id_in_layer_) {
|
| - DCHECK(id_to_mailbox_.find(previous_buffer) != id_to_mailbox_.end());
|
| - ImageTransportFactoryAndroid::GetInstance()->ReleaseTexture(
|
| - texture_id_in_layer_,
|
| - reinterpret_cast<const signed char*>(
|
| - id_to_mailbox_[previous_buffer].c_str()));
|
| - }
|
| -
|
| - current_buffer_id_ = params.surface_handle;
|
| - if (!texture_id_in_layer_) {
|
| - texture_id_in_layer_ = factory->CreateTexture();
|
| - texture_layer_->setTextureId(texture_id_in_layer_);
|
| - }
|
| -
|
| - DCHECK(id_to_mailbox_.find(current_buffer_id_) != id_to_mailbox_.end());
|
| - ImageTransportFactoryAndroid::GetInstance()->AcquireTexture(
|
| - texture_id_in_layer_,
|
| - reinterpret_cast<const signed char*>(
|
| - id_to_mailbox_[current_buffer_id_].c_str()));
|
| - texture_layer_->setNeedsDisplay();
|
| - texture_layer_->setBounds(params.size);
|
| - texture_size_in_layer_ = params.size;
|
| -
|
| uint32 sync_point =
|
| ImageTransportFactoryAndroid::GetInstance()->InsertSyncPoint();
|
| RenderWidgetHostImpl::AcknowledgeBufferPresent(
|
| - params.route_id, gpu_host_id, previous_buffer, sync_point);
|
| + params.route_id, gpu_host_id, true, sync_point);
|
| }
|
|
|
| void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer(
|
| @@ -441,23 +413,6 @@
|
| NOTREACHED();
|
| }
|
|
|
| -void RenderWidgetHostViewAndroid::AcceleratedSurfaceNew(
|
| - int32 width_in_pixel, int32 height_in_pixel, uint64 surface_id,
|
| - const std::string& mailbox_name) {
|
| - DCHECK(surface_id == 1 || surface_id == 2);
|
| - id_to_mailbox_[surface_id] = mailbox_name;
|
| -}
|
| -
|
| -void RenderWidgetHostViewAndroid::AcceleratedSurfaceRelease() {
|
| - // This tells us we should free the frontbuffer.
|
| - if (texture_id_in_layer_) {
|
| - texture_layer_->setTextureId(0);
|
| - ImageTransportFactoryAndroid::GetInstance()->DeleteTexture(
|
| - texture_id_in_layer_);
|
| - texture_id_in_layer_ = 0;
|
| - }
|
| -}
|
| -
|
| bool RenderWidgetHostViewAndroid::HasAcceleratedSurface(
|
| const gfx::Size& desired_size) {
|
| NOTREACHED();
|
|
|