| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2852 PrepareGeometry(SHARED_BINDING); | 2852 PrepareGeometry(SHARED_BINDING); |
| 2853 gfx::Transform quad_rect_matrix; | 2853 gfx::Transform quad_rect_matrix; |
| 2854 QuadRectTransform(&quad_rect_matrix, draw_transform, quad_rect); | 2854 QuadRectTransform(&quad_rect_matrix, draw_transform, quad_rect); |
| 2855 static float gl_matrix[16]; | 2855 static float gl_matrix[16]; |
| 2856 ToGLMatrix(&gl_matrix[0], projection_matrix * quad_rect_matrix); | 2856 ToGLMatrix(&gl_matrix[0], projection_matrix * quad_rect_matrix); |
| 2857 gl_->UniformMatrix4fv(matrix_location, 1, false, &gl_matrix[0]); | 2857 gl_->UniformMatrix4fv(matrix_location, 1, false, &gl_matrix[0]); |
| 2858 | 2858 |
| 2859 gl_->DrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); | 2859 gl_->DrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); |
| 2860 } | 2860 } |
| 2861 | 2861 |
| 2862 void GLRenderer::Finish() { | |
| 2863 TRACE_EVENT0("cc", "GLRenderer::Finish"); | |
| 2864 gl_->Finish(); | |
| 2865 } | |
| 2866 | |
| 2867 void GLRenderer::SwapBuffers(CompositorFrameMetadata metadata) { | 2862 void GLRenderer::SwapBuffers(CompositorFrameMetadata metadata) { |
| 2868 DCHECK(!is_backbuffer_discarded_); | 2863 DCHECK(!is_backbuffer_discarded_); |
| 2869 | 2864 |
| 2870 TRACE_EVENT0("cc,benchmark", "GLRenderer::SwapBuffers"); | 2865 TRACE_EVENT0("cc,benchmark", "GLRenderer::SwapBuffers"); |
| 2871 // We're done! Time to swapbuffers! | 2866 // We're done! Time to swapbuffers! |
| 2872 | 2867 |
| 2873 gfx::Size surface_size = output_surface_->SurfaceSize(); | 2868 gfx::Size surface_size = output_surface_->SurfaceSize(); |
| 2874 | 2869 |
| 2875 CompositorFrame compositor_frame; | 2870 CompositorFrame compositor_frame; |
| 2876 compositor_frame.metadata = std::move(metadata); | 2871 compositor_frame.metadata = std::move(metadata); |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4031 | 4026 |
| 4032 gl_->ScheduleCALayerSharedStateCHROMIUM( | 4027 gl_->ScheduleCALayerSharedStateCHROMIUM( |
| 4033 ca_layer_overlay->shared_state->opacity, is_clipped, clip_rect, | 4028 ca_layer_overlay->shared_state->opacity, is_clipped, clip_rect, |
| 4034 sorting_context_id, gl_transform); | 4029 sorting_context_id, gl_transform); |
| 4035 gl_->ScheduleCALayerCHROMIUM( | 4030 gl_->ScheduleCALayerCHROMIUM( |
| 4036 texture_id, contents_rect, ca_layer_overlay->background_color, | 4031 texture_id, contents_rect, ca_layer_overlay->background_color, |
| 4037 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); | 4032 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); |
| 4038 } | 4033 } |
| 4039 | 4034 |
| 4040 } // namespace cc | 4035 } // namespace cc |
| OLD | NEW |