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