Chromium Code Reviews| 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/renderer/render_widget_fullscreen_pepper.h" | 5 #include "content/renderer/render_widget_fullscreen_pepper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 gfx::Rect* clip, | 512 gfx::Rect* clip, |
| 513 float* scale_factor) { | 513 float* scale_factor) { |
| 514 if (plugin_ && plugin_->GetBitmapForOptimizedPluginPaint( | 514 if (plugin_ && plugin_->GetBitmapForOptimizedPluginPaint( |
| 515 paint_bounds, dib, location, clip, scale_factor)) { | 515 paint_bounds, dib, location, clip, scale_factor)) { |
| 516 return plugin_; | 516 return plugin_; |
| 517 } | 517 } |
| 518 return NULL; | 518 return NULL; |
| 519 } | 519 } |
| 520 | 520 |
| 521 void RenderWidgetFullscreenPepper::OnResize(const gfx::Size& size, | 521 void RenderWidgetFullscreenPepper::OnResize(const gfx::Size& size, |
| 522 const gfx::Rect& resizer_rect, | 522 const gfx::Size& physical_backing_size, |
| 523 bool is_fullscreen) { | 523 const gfx::Rect& resizer_rect, |
| 524 bool is_fullscreen) { | |
| 524 if (context_) { | 525 if (context_) { |
| 526 // FIXME: Try using physical_backing_size here instead of manually | |
|
piman
2013/02/27 08:12:11
nit: style is TODO(aelias):
I think you can do ju
| |
| 527 // scaling by deviceScaleFactor. | |
| 525 gfx::Size pixel_size = gfx::ToFlooredSize( | 528 gfx::Size pixel_size = gfx::ToFlooredSize( |
| 526 gfx::ScaleSize(size, deviceScaleFactor())); | 529 gfx::ScaleSize(size, deviceScaleFactor())); |
| 527 context_->reshape(pixel_size.width(), pixel_size.height()); | 530 context_->reshape(pixel_size.width(), pixel_size.height()); |
| 528 context_->viewport(0, 0, pixel_size.width(), pixel_size.height()); | 531 context_->viewport(0, 0, pixel_size.width(), pixel_size.height()); |
| 529 } | 532 } |
| 530 RenderWidget::OnResize(size, resizer_rect, is_fullscreen); | 533 RenderWidget::OnResize(size, physical_backing_size, resizer_rect, |
| 534 is_fullscreen); | |
| 531 } | 535 } |
| 532 | 536 |
| 533 WebWidget* RenderWidgetFullscreenPepper::CreateWebWidget() { | 537 WebWidget* RenderWidgetFullscreenPepper::CreateWebWidget() { |
| 534 return new PepperWidget(this); | 538 return new PepperWidget(this); |
| 535 } | 539 } |
| 536 | 540 |
| 537 bool RenderWidgetFullscreenPepper::SupportsAsynchronousSwapBuffers() { | 541 bool RenderWidgetFullscreenPepper::SupportsAsynchronousSwapBuffers() { |
| 538 return context_ != NULL; | 542 return context_ != NULL; |
| 539 } | 543 } |
| 540 | 544 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 705 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { | 709 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { |
| 706 if (!context_) { | 710 if (!context_) { |
| 707 CreateContext(); | 711 CreateContext(); |
| 708 } | 712 } |
| 709 if (!context_) | 713 if (!context_) |
| 710 return NULL; | 714 return NULL; |
| 711 return context_; | 715 return context_; |
| 712 } | 716 } |
| 713 | 717 |
| 714 } // namespace content | 718 } // namespace content |
| OLD | NEW |