| 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/browser/renderer_host/compositing_iosurface_mac.h" | 5 #include "content/browser/renderer_host/compositing_iosurface_mac.h" |
| 6 | 6 |
| 7 #include <OpenGL/OpenGL.h> | 7 #include <OpenGL/OpenGL.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #define CHECK_GL_ERROR() | 21 #define CHECK_GL_ERROR() |
| 22 #else | 22 #else |
| 23 #define CHECK_GL_ERROR() do { \ | 23 #define CHECK_GL_ERROR() do { \ |
| 24 GLenum gl_error = glGetError(); \ | 24 GLenum gl_error = glGetError(); \ |
| 25 LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ | 25 LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ |
| 26 } while (0) | 26 } while (0) |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 #define SHADER_STRING_GLSL(shader) #shader | 29 #define SHADER_STRING_GLSL(shader) #shader |
| 30 | 30 |
| 31 namespace content { |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 static const char* g_vertex_shader_blit_rgb = SHADER_STRING_GLSL( | 34 static const char* g_vertex_shader_blit_rgb = SHADER_STRING_GLSL( |
| 34 varying vec2 texture_coordinate; | 35 varying vec2 texture_coordinate; |
| 35 void main() { | 36 void main() { |
| 36 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | 37 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; |
| 37 texture_coordinate = vec2(gl_MultiTexCoord0); | 38 texture_coordinate = vec2(gl_MultiTexCoord0); |
| 38 }); | 39 }); |
| 39 | 40 |
| 40 static const char* g_fragment_shader_blit_rgb = SHADER_STRING_GLSL( | 41 static const char* g_fragment_shader_blit_rgb = SHADER_STRING_GLSL( |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 459 } |
| 459 | 460 |
| 460 void CompositingIOSurfaceMac::GlobalFrameDidChange() { | 461 void CompositingIOSurfaceMac::GlobalFrameDidChange() { |
| 461 [glContext_ update]; | 462 [glContext_ update]; |
| 462 } | 463 } |
| 463 | 464 |
| 464 void CompositingIOSurfaceMac::ClearDrawable() { | 465 void CompositingIOSurfaceMac::ClearDrawable() { |
| 465 [glContext_ clearDrawable]; | 466 [glContext_ clearDrawable]; |
| 466 UnrefIOSurface(); | 467 UnrefIOSurface(); |
| 467 } | 468 } |
| 469 |
| 470 } // namespace content |
| OLD | NEW |