| 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/render_pass_draw_quad.h" | 8 #include "cc/quads/render_pass_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 25 matching lines...) Expand all Loading... |
| 36 CA_LAYER_FAILED_RENDER_PASS, | 36 CA_LAYER_FAILED_RENDER_PASS, |
| 37 CA_LAYER_FAILED_SURFACE_CONTENT, | 37 CA_LAYER_FAILED_SURFACE_CONTENT, |
| 38 CA_LAYER_FAILED_YUV_VIDEO_CONTENT, | 38 CA_LAYER_FAILED_YUV_VIDEO_CONTENT, |
| 39 CA_LAYER_FAILED_DIFFERENT_CLIP_SETTINGS, | 39 CA_LAYER_FAILED_DIFFERENT_CLIP_SETTINGS, |
| 40 CA_LAYER_FAILED_DIFFERENT_VERTEX_OPACITIES, | 40 CA_LAYER_FAILED_DIFFERENT_VERTEX_OPACITIES, |
| 41 CA_LAYER_FAILED_RENDER_PASS_FILTER_SCALE, | 41 CA_LAYER_FAILED_RENDER_PASS_FILTER_SCALE, |
| 42 CA_LAYER_FAILED_RENDER_PASS_BACKGROUND_FILTERS, | 42 CA_LAYER_FAILED_RENDER_PASS_BACKGROUND_FILTERS, |
| 43 CA_LAYER_FAILED_RENDER_PASS_MASK, | 43 CA_LAYER_FAILED_RENDER_PASS_MASK, |
| 44 CA_LAYER_FAILED_RENDER_PASS_FILTER_OPERATION, | 44 CA_LAYER_FAILED_RENDER_PASS_FILTER_OPERATION, |
| 45 CA_LAYER_FAILED_RENDER_PASS_SORTING_CONTEXT_ID, | 45 CA_LAYER_FAILED_RENDER_PASS_SORTING_CONTEXT_ID, |
| 46 CA_LAYER_FAILED_Y_VIDEO_CONTENT, |
| 46 CA_LAYER_FAILED_COUNT, | 47 CA_LAYER_FAILED_COUNT, |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 bool FilterOperationSupported(const FilterOperation& operation) { | 50 bool FilterOperationSupported(const FilterOperation& operation) { |
| 50 switch (operation.type()) { | 51 switch (operation.type()) { |
| 51 case FilterOperation::GRAYSCALE: | 52 case FilterOperation::GRAYSCALE: |
| 52 case FilterOperation::SEPIA: | 53 case FilterOperation::SEPIA: |
| 53 case FilterOperation::SATURATE: | 54 case FilterOperation::SATURATE: |
| 54 case FilterOperation::HUE_ROTATE: | 55 case FilterOperation::HUE_ROTATE: |
| 55 case FilterOperation::INVERT: | 56 case FilterOperation::INVERT: |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 case DrawQuad::PICTURE_CONTENT: | 221 case DrawQuad::PICTURE_CONTENT: |
| 221 return CA_LAYER_FAILED_PICTURE_CONTENT; | 222 return CA_LAYER_FAILED_PICTURE_CONTENT; |
| 222 case DrawQuad::RENDER_PASS: | 223 case DrawQuad::RENDER_PASS: |
| 223 return FromRenderPassQuad(resource_provider, | 224 return FromRenderPassQuad(resource_provider, |
| 224 RenderPassDrawQuad::MaterialCast(quad), | 225 RenderPassDrawQuad::MaterialCast(quad), |
| 225 ca_layer_overlay); | 226 ca_layer_overlay); |
| 226 case DrawQuad::SURFACE_CONTENT: | 227 case DrawQuad::SURFACE_CONTENT: |
| 227 return CA_LAYER_FAILED_SURFACE_CONTENT; | 228 return CA_LAYER_FAILED_SURFACE_CONTENT; |
| 228 case DrawQuad::YUV_VIDEO_CONTENT: | 229 case DrawQuad::YUV_VIDEO_CONTENT: |
| 229 return CA_LAYER_FAILED_YUV_VIDEO_CONTENT; | 230 return CA_LAYER_FAILED_YUV_VIDEO_CONTENT; |
| 231 case DrawQuad::Y_VIDEO_CONTENT: |
| 232 return CA_LAYER_FAILED_Y_VIDEO_CONTENT; |
| 230 default: | 233 default: |
| 231 break; | 234 break; |
| 232 } | 235 } |
| 233 | 236 |
| 234 return CA_LAYER_FAILED_UNKNOWN; | 237 return CA_LAYER_FAILED_UNKNOWN; |
| 235 } | 238 } |
| 236 | 239 |
| 237 private: | 240 private: |
| 238 const SharedQuadState* most_recent_shared_quad_state_ = nullptr; | 241 const SharedQuadState* most_recent_shared_quad_state_ = nullptr; |
| 239 scoped_refptr<CALayerOverlaySharedState> most_recent_overlay_shared_state_; | 242 scoped_refptr<CALayerOverlaySharedState> most_recent_overlay_shared_state_; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 CA_LAYER_FAILED_COUNT); | 295 CA_LAYER_FAILED_COUNT); |
| 293 | 296 |
| 294 if (result != CA_LAYER_SUCCESS) { | 297 if (result != CA_LAYER_SUCCESS) { |
| 295 ca_layer_overlays->clear(); | 298 ca_layer_overlays->clear(); |
| 296 return false; | 299 return false; |
| 297 } | 300 } |
| 298 return true; | 301 return true; |
| 299 } | 302 } |
| 300 | 303 |
| 301 } // namespace cc | 304 } // namespace cc |
| OLD | NEW |