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 2874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2885 PrepareGeometry(SHARED_BINDING); | 2885 PrepareGeometry(SHARED_BINDING); |
2886 gfx::Transform quad_rect_matrix; | 2886 gfx::Transform quad_rect_matrix; |
2887 QuadRectTransform(&quad_rect_matrix, draw_transform, quad_rect); | 2887 QuadRectTransform(&quad_rect_matrix, draw_transform, quad_rect); |
2888 static float gl_matrix[16]; | 2888 static float gl_matrix[16]; |
2889 ToGLMatrix(&gl_matrix[0], projection_matrix * quad_rect_matrix); | 2889 ToGLMatrix(&gl_matrix[0], projection_matrix * quad_rect_matrix); |
2890 gl_->UniformMatrix4fv(matrix_location, 1, false, &gl_matrix[0]); | 2890 gl_->UniformMatrix4fv(matrix_location, 1, false, &gl_matrix[0]); |
2891 | 2891 |
2892 gl_->DrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); | 2892 gl_->DrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); |
2893 } | 2893 } |
2894 | 2894 |
2895 void GLRenderer::SwapBuffers(std::vector<ui::LatencyInfo> latency_info) { | 2895 void GLRenderer::SwapBuffers(OutputSurfaceFrame output_frame) { |
2896 DCHECK(visible_); | 2896 DCHECK(visible_); |
2897 | 2897 |
2898 TRACE_EVENT0("cc", "GLRenderer::SwapBuffers"); | 2898 TRACE_EVENT0("cc", "GLRenderer::SwapBuffers"); |
2899 // We're done! Time to swapbuffers! | 2899 // We're done! Time to swapbuffers! |
2900 | 2900 |
2901 gfx::Size surface_size = surface_size_for_swap_buffers(); | 2901 gfx::Size surface_size = surface_size_for_swap_buffers(); |
2902 | 2902 |
2903 OutputSurfaceFrame output_frame; | |
2904 output_frame.latency_info = std::move(latency_info); | |
2905 output_frame.size = surface_size; | 2903 output_frame.size = surface_size; |
2906 if (use_partial_swap_) { | 2904 if (use_partial_swap_) { |
2907 // If supported, we can save significant bandwidth by only swapping the | 2905 // If supported, we can save significant bandwidth by only swapping the |
2908 // damaged/scissored region (clamped to the viewport). | 2906 // damaged/scissored region (clamped to the viewport). |
2909 swap_buffer_rect_.Intersect(gfx::Rect(surface_size)); | 2907 swap_buffer_rect_.Intersect(gfx::Rect(surface_size)); |
2910 int flipped_y_pos_of_rect_bottom = surface_size.height() - | 2908 int flipped_y_pos_of_rect_bottom = surface_size.height() - |
2911 swap_buffer_rect_.y() - | 2909 swap_buffer_rect_.y() - |
2912 swap_buffer_rect_.height(); | 2910 swap_buffer_rect_.height(); |
2913 output_frame.sub_buffer_rect = | 2911 output_frame.sub_buffer_rect = |
2914 gfx::Rect(swap_buffer_rect_.x(), | 2912 gfx::Rect(swap_buffer_rect_.x(), |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4041 // The alpha has already been applied when copying the RPDQ to an IOSurface. | 4039 // The alpha has already been applied when copying the RPDQ to an IOSurface. |
4042 GLfloat alpha = 1; | 4040 GLfloat alpha = 1; |
4043 gl_->ScheduleCALayerSharedStateCHROMIUM(alpha, is_clipped, clip_rect, | 4041 gl_->ScheduleCALayerSharedStateCHROMIUM(alpha, is_clipped, clip_rect, |
4044 sorting_context_id, gl_transform); | 4042 sorting_context_id, gl_transform); |
4045 gl_->ScheduleCALayerCHROMIUM( | 4043 gl_->ScheduleCALayerCHROMIUM( |
4046 texture_id, contents_rect, ca_layer_overlay->background_color, | 4044 texture_id, contents_rect, ca_layer_overlay->background_color, |
4047 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); | 4045 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); |
4048 } | 4046 } |
4049 | 4047 |
4050 } // namespace cc | 4048 } // namespace cc |
OLD | NEW |