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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // ContentViewCoreImpl represents the native side of the Java | 301 // ContentViewCoreImpl represents the native side of the Java |
302 // ContentViewCore. It being NULL means that it is not attached | 302 // ContentViewCore. It being NULL means that it is not attached |
303 // to the View system yet, so we treat this RWHVA as hidden. | 303 // to the View system yet, so we treat this RWHVA as hidden. |
304 return is_layer_attached_ && content_view_core_; | 304 return is_layer_attached_ && content_view_core_; |
305 } | 305 } |
306 | 306 |
307 gfx::Rect RenderWidgetHostViewAndroid::GetViewBounds() const { | 307 gfx::Rect RenderWidgetHostViewAndroid::GetViewBounds() const { |
308 if (!content_view_core_) | 308 if (!content_view_core_) |
309 return gfx::Rect(); | 309 return gfx::Rect(); |
310 | 310 |
| 311 // If the backing hasn't been initialized yet, report empty view bounds |
| 312 // as well. Otherwise, we may end up stuck in a white-screen state because |
| 313 // the resize ack is sent after swapbuffers. |
| 314 if (GetPhysicalBackingSize().IsEmpty()) |
| 315 return gfx::Rect(); |
| 316 |
311 return gfx::Rect(content_view_core_->GetViewportSizeDip()); | 317 return gfx::Rect(content_view_core_->GetViewportSizeDip()); |
312 } | 318 } |
313 | 319 |
314 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { | 320 gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { |
315 if (!content_view_core_) | 321 if (!content_view_core_) |
316 return gfx::Size(); | 322 return gfx::Size(); |
317 | 323 |
318 return content_view_core_->GetPhysicalBackingSize(); | 324 return content_view_core_->GetPhysicalBackingSize(); |
319 } | 325 } |
320 | 326 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 // RenderWidgetHostView, public: | 746 // RenderWidgetHostView, public: |
741 | 747 |
742 // static | 748 // static |
743 RenderWidgetHostView* | 749 RenderWidgetHostView* |
744 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 750 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
745 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 751 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
746 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 752 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
747 } | 753 } |
748 | 754 |
749 } // namespace content | 755 } // namespace content |
OLD | NEW |