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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "content/common/gpu/client/gpu_channel_host.h" | 9 #include "content/common/gpu/client/gpu_channel_host.h" |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 | 78 |
79 virtual void paint(WebCanvas* canvas, const WebRect& rect) { | 79 virtual void paint(WebCanvas* canvas, const WebRect& rect) { |
80 if (!widget_->plugin()) | 80 if (!widget_->plugin()) |
81 return; | 81 return; |
82 | 82 |
83 WebRect plugin_rect(0, 0, size_.width, size_.height); | 83 WebRect plugin_rect(0, 0, size_.width, size_.height); |
84 widget_->plugin()->Paint(canvas, plugin_rect, rect); | 84 widget_->plugin()->Paint(canvas, plugin_rect, rect); |
85 } | 85 } |
86 | 86 |
| 87 #if WEBWIDGET_HAS_SETCOMPOSITORSURFACEREADY |
| 88 virtual void setCompositorSurfaceReady() { |
| 89 } |
| 90 #endif |
| 91 |
87 virtual void composite(bool finish) { | 92 virtual void composite(bool finish) { |
88 if (!widget_->plugin()) | 93 if (!widget_->plugin()) |
89 return; | 94 return; |
90 | 95 |
91 WebGraphicsContext3DCommandBufferImpl* context = widget_->context(); | 96 WebGraphicsContext3DCommandBufferImpl* context = widget_->context(); |
92 DCHECK(context); | 97 DCHECK(context); |
93 unsigned int texture = widget_->plugin()->GetBackingTextureId(); | 98 unsigned int texture = widget_->plugin()->GetBackingTextureId(); |
94 context->bindTexture(GL_TEXTURE_2D, texture); | 99 context->bindTexture(GL_TEXTURE_2D, texture); |
95 context->drawArrays(GL_TRIANGLES, 0, 3); | 100 context->drawArrays(GL_TRIANGLES, 0, 3); |
96 widget_->SwapBuffers(); | 101 widget_->SwapBuffers(); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 | 516 |
512 WebGraphicsContext3DCommandBufferImpl* | 517 WebGraphicsContext3DCommandBufferImpl* |
513 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { | 518 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { |
514 if (!context_) { | 519 if (!context_) { |
515 CreateContext(); | 520 CreateContext(); |
516 } | 521 } |
517 if (!context_) | 522 if (!context_) |
518 return NULL; | 523 return NULL; |
519 return context_; | 524 return context_; |
520 } | 525 } |
OLD | NEW |