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