| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/view_messages.h" | 9 #include "content/common/view_messages.h" |
| 10 #include "content/renderer/gpu/gpu_channel_host.h" | 10 #include "content/renderer/gpu/gpu_channel_host.h" |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 const float kTexCoords[] = { | 417 const float kTexCoords[] = { |
| 418 0.f, 0.f, | 418 0.f, 0.f, |
| 419 0.f, 2.f, | 419 0.f, 2.f, |
| 420 2.f, 0.f, | 420 2.f, 0.f, |
| 421 }; | 421 }; |
| 422 | 422 |
| 423 } // anonymous namespace | 423 } // anonymous namespace |
| 424 | 424 |
| 425 bool RenderWidgetFullscreenPepper::InitContext() { | 425 bool RenderWidgetFullscreenPepper::InitContext() { |
| 426 gpu::gles2::GLES2Implementation* gl = context_->GetImplementation(); | 426 gpu::gles2::GLES2Implementation* gl = context_->GetImplementation(); |
| 427 gl->ResizeCHROMIUM(size().width(), size().height()); |
| 428 gl->Viewport(0, 0, size().width(), size().height()); |
| 429 |
| 427 program_ = gl->CreateProgram(); | 430 program_ = gl->CreateProgram(); |
| 428 | 431 |
| 429 GLuint vertex_shader = | 432 GLuint vertex_shader = |
| 430 CreateShaderFromSource(gl, GL_VERTEX_SHADER, kVertexShader); | 433 CreateShaderFromSource(gl, GL_VERTEX_SHADER, kVertexShader); |
| 431 if (!vertex_shader) | 434 if (!vertex_shader) |
| 432 return false; | 435 return false; |
| 433 gl->AttachShader(program_, vertex_shader); | 436 gl->AttachShader(program_, vertex_shader); |
| 434 gl->DeleteShader(vertex_shader); | 437 gl->DeleteShader(vertex_shader); |
| 435 | 438 |
| 436 GLuint fragment_shader = | 439 GLuint fragment_shader = |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 514 |
| 512 RendererGLContext* | 515 RendererGLContext* |
| 513 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { | 516 RenderWidgetFullscreenPepper::GetParentContextForPlatformContext3D() { |
| 514 if (!context_) { | 517 if (!context_) { |
| 515 CreateContext(); | 518 CreateContext(); |
| 516 } | 519 } |
| 517 if (!context_) | 520 if (!context_) |
| 518 return NULL; | 521 return NULL; |
| 519 return context_; | 522 return context_; |
| 520 } | 523 } |
| OLD | NEW |