| 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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 const TileDrawQuad* GLRenderer::CanPassBeDrawnDirectly(const RenderPass* pass) { | 989 const TileDrawQuad* GLRenderer::CanPassBeDrawnDirectly(const RenderPass* pass) { |
| 990 // Can only collapse a single tile quad. | 990 // Can only collapse a single tile quad. |
| 991 if (pass->quad_list.size() != 1) | 991 if (pass->quad_list.size() != 1) |
| 992 return nullptr; | 992 return nullptr; |
| 993 // If we need copy requests, then render pass has to exist. | 993 // If we need copy requests, then render pass has to exist. |
| 994 if (!pass->copy_requests.empty()) | 994 if (!pass->copy_requests.empty()) |
| 995 return nullptr; | 995 return nullptr; |
| 996 | 996 |
| 997 const DrawQuad* quad = *pass->quad_list.BackToFrontBegin(); | 997 const DrawQuad* quad = *pass->quad_list.BackToFrontBegin(); |
| 998 // Hack: this could be supported by concatenating transforms, but | 998 // Hack: this could be supported by concatenating transforms, but |
| 999 // in practice if there is one quad, it is at the origin of the render pass. | 999 // in practice if there is one quad, it is at the origin of the render pass |
| 1000 if (!quad->shared_quad_state->quad_to_target_transform.IsIdentity()) | 1000 // and has the same size as the pass. |
| 1001 if (!quad->shared_quad_state->quad_to_target_transform.IsIdentity() || |
| 1002 quad->rect != pass->output_rect) |
| 1001 return nullptr; | 1003 return nullptr; |
| 1002 // The quad is expected to be the entire layer so that AA edges are correct. | 1004 // The quad is expected to be the entire layer so that AA edges are correct. |
| 1003 if (gfx::Rect(quad->shared_quad_state->quad_layer_bounds) != quad->rect) | 1005 if (gfx::Rect(quad->shared_quad_state->quad_layer_bounds) != quad->rect) |
| 1004 return nullptr; | 1006 return nullptr; |
| 1005 if (quad->material != DrawQuad::TILED_CONTENT) | 1007 if (quad->material != DrawQuad::TILED_CONTENT) |
| 1006 return nullptr; | 1008 return nullptr; |
| 1007 | 1009 |
| 1008 const TileDrawQuad* tile_quad = TileDrawQuad::MaterialCast(quad); | 1010 const TileDrawQuad* tile_quad = TileDrawQuad::MaterialCast(quad); |
| 1009 // Hack: this could be supported by passing in a subrectangle to draw | 1011 // Hack: this could be supported by passing in a subrectangle to draw |
| 1010 // render pass, although in practice if there is only one quad there | 1012 // render pass, although in practice if there is only one quad there |
| (...skipping 3030 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. | 4043 // The alpha has already been applied when copying the RPDQ to an IOSurface. |
| 4042 GLfloat alpha = 1; | 4044 GLfloat alpha = 1; |
| 4043 gl_->ScheduleCALayerSharedStateCHROMIUM(alpha, is_clipped, clip_rect, | 4045 gl_->ScheduleCALayerSharedStateCHROMIUM(alpha, is_clipped, clip_rect, |
| 4044 sorting_context_id, gl_transform); | 4046 sorting_context_id, gl_transform); |
| 4045 gl_->ScheduleCALayerCHROMIUM( | 4047 gl_->ScheduleCALayerCHROMIUM( |
| 4046 texture_id, contents_rect, ca_layer_overlay->background_color, | 4048 texture_id, contents_rect, ca_layer_overlay->background_color, |
| 4047 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); | 4049 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); |
| 4048 } | 4050 } |
| 4049 | 4051 |
| 4050 } // namespace cc | 4052 } // namespace cc |
| OLD | NEW |