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_) { |
525 gfx::Size pixel_size = gfx::ToFlooredSize( | 526 context_->reshape(physical_backing_size.width(), |
526 gfx::ScaleSize(size, deviceScaleFactor())); | 527 physical_backing_size.height()); |
527 context_->reshape(pixel_size.width(), pixel_size.height()); | 528 context_->viewport(0, 0, |
528 context_->viewport(0, 0, pixel_size.width(), pixel_size.height()); | 529 physical_backing_size.width(), |
| 530 physical_backing_size.height()); |
529 } | 531 } |
530 RenderWidget::OnResize(size, resizer_rect, is_fullscreen); | 532 RenderWidget::OnResize(size, physical_backing_size, resizer_rect, |
| 533 is_fullscreen); |
531 } | 534 } |
532 | 535 |
533 WebWidget* RenderWidgetFullscreenPepper::CreateWebWidget() { | 536 WebWidget* RenderWidgetFullscreenPepper::CreateWebWidget() { |
534 return new PepperWidget(this); | 537 return new PepperWidget(this); |
535 } | 538 } |
536 | 539 |
537 bool RenderWidgetFullscreenPepper::SupportsAsynchronousSwapBuffers() { | 540 bool RenderWidgetFullscreenPepper::SupportsAsynchronousSwapBuffers() { |
538 return context_ != NULL; | 541 return context_ != NULL; |
539 } | 542 } |
540 | 543 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { | 708 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { |
706 if (!context_) { | 709 if (!context_) { |
707 CreateContext(); | 710 CreateContext(); |
708 } | 711 } |
709 if (!context_) | 712 if (!context_) |
710 return NULL; | 713 return NULL; |
711 return context_; | 714 return context_; |
712 } | 715 } |
713 | 716 |
714 } // namespace content | 717 } // namespace content |
OLD | NEW |