Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2084)

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 10941017: Change the scale factor of texture_size from the layer's one to an estimation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 28162bc3b0f1056d11947b80fa22e1bd9bde504e..fbd5aa0f7ae5c15e21768b66428d7dbb49dcd461 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -262,6 +262,7 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host)
text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
can_compose_inline_(true),
has_composition_text_(false),
+ device_scale_factor_(1.0f),
current_surface_(0),
current_surface_is_protected_(true),
current_surface_in_use_by_compositor_(true),
@@ -926,7 +927,8 @@ void RenderWidgetHostViewAura::AcceleratedSurfaceNew(
uint64 surface_handle) {
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
scoped_refptr<ui::Texture> surface(factory->CreateTransportClient(
- gfx::Size(width_in_pixel, height_in_pixel), surface_handle));
+ gfx::Size(width_in_pixel, height_in_pixel), device_scale_factor_,
+ surface_handle));
if (!surface) {
LOG(ERROR) << "Failed to create ImageTransport texture";
return;
@@ -1349,6 +1351,7 @@ void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged(
if (!host_)
return;
+ device_scale_factor_ = device_scale_factor;
BackingStoreAura* backing_store = static_cast<BackingStoreAura*>(
host_->GetBackingStore(false));
if (backing_store) // NULL in hardware path.
@@ -1410,7 +1413,8 @@ scoped_refptr<ui::Texture> RenderWidgetHostViewAura::CopyTexture() {
return scoped_refptr<ui::Texture>();
return scoped_refptr<ui::Texture>(
- factory->CreateOwnedTexture(container->size(), texture_id));
+ factory->CreateOwnedTexture(
+ container->size(), device_scale_factor_, texture_id));
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698