| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ca_layer_overlay.h" | 5 #include "cc/output/ca_layer_overlay.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "cc/quads/io_surface_draw_quad.h" | 8 #include "cc/quads/io_surface_draw_quad.h" |
| 9 #include "cc/quads/solid_color_draw_quad.h" | 9 #include "cc/quads/solid_color_draw_quad.h" |
| 10 #include "cc/quads/stream_video_draw_quad.h" | 10 #include "cc/quads/stream_video_draw_quad.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 ca_layer_overlay->background_color = quad->color; | 76 ca_layer_overlay->background_color = quad->color; |
| 77 return CA_LAYER_SUCCESS; | 77 return CA_LAYER_SUCCESS; |
| 78 } | 78 } |
| 79 | 79 |
| 80 CALayerResult FromTextureQuad(ResourceProvider* resource_provider, | 80 CALayerResult FromTextureQuad(ResourceProvider* resource_provider, |
| 81 const TextureDrawQuad* quad, | 81 const TextureDrawQuad* quad, |
| 82 CALayerOverlay* ca_layer_overlay) { | 82 CALayerOverlay* ca_layer_overlay) { |
| 83 unsigned resource_id = quad->resource_id(); | 83 unsigned resource_id = quad->resource_id(); |
| 84 if (!resource_provider->IsOverlayCandidate(resource_id)) | 84 if (!resource_provider->IsOverlayCandidate(resource_id)) |
| 85 return CA_LAYER_FAILED_TEXTURE_NOT_CANDIDATE; | 85 return CA_LAYER_FAILED_TEXTURE_NOT_CANDIDATE; |
| 86 // The filter has not yet been plumbed through the CoreAnimation compositor, |
| 87 // so we can't use it for non-default minification/magnification filters. |
| 88 // https://crbug.com/602103 |
| 89 if (quad->nearest_neighbor) |
| 90 return CA_LAYER_FAILED_TEXTURE_NOT_CANDIDATE; |
| 86 if (quad->y_flipped) { | 91 if (quad->y_flipped) { |
| 87 // The anchor point is at the bottom-left corner of the CALayer. The | 92 // The anchor point is at the bottom-left corner of the CALayer. The |
| 88 // transformation that flips the contents of the layer without changing its | 93 // transformation that flips the contents of the layer without changing its |
| 89 // frame is the composition of a vertical flip about the anchor point, and a | 94 // frame is the composition of a vertical flip about the anchor point, and a |
| 90 // translation by the height of the layer. | 95 // translation by the height of the layer. |
| 91 ca_layer_overlay->transform.preTranslate( | 96 ca_layer_overlay->transform.preTranslate( |
| 92 0, ca_layer_overlay->bounds_rect.height(), 0); | 97 0, ca_layer_overlay->bounds_rect.height(), 0); |
| 93 ca_layer_overlay->transform.preScale(1, -1, 1); | 98 ca_layer_overlay->transform.preScale(1, -1, 1); |
| 94 } | 99 } |
| 95 ca_layer_overlay->contents_resource_id = resource_id; | 100 ca_layer_overlay->contents_resource_id = resource_id; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 CA_LAYER_FAILED_COUNT); | 244 CA_LAYER_FAILED_COUNT); |
| 240 | 245 |
| 241 if (result != CA_LAYER_SUCCESS) { | 246 if (result != CA_LAYER_SUCCESS) { |
| 242 ca_layer_overlays->clear(); | 247 ca_layer_overlays->clear(); |
| 243 return false; | 248 return false; |
| 244 } | 249 } |
| 245 return true; | 250 return true; |
| 246 } | 251 } |
| 247 | 252 |
| 248 } // namespace cc | 253 } // namespace cc |
| OLD | NEW |