| 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/solid_color_draw_quad.h" | 8 #include "cc/quads/solid_color_draw_quad.h" |
| 9 #include "cc/quads/stream_video_draw_quad.h" | 9 #include "cc/quads/stream_video_draw_quad.h" |
| 10 #include "cc/quads/texture_draw_quad.h" | 10 #include "cc/quads/texture_draw_quad.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 CA_LAYER_FAILED_TEXTURE_Y_FLIPPED, | 28 CA_LAYER_FAILED_TEXTURE_Y_FLIPPED, |
| 29 CA_LAYER_FAILED_TILE_NOT_CANDIDATE, | 29 CA_LAYER_FAILED_TILE_NOT_CANDIDATE, |
| 30 CA_LAYER_FAILED_QUAD_BLEND_MODE, | 30 CA_LAYER_FAILED_QUAD_BLEND_MODE, |
| 31 CA_LAYER_FAILED_QUAD_TRANSFORM, | 31 CA_LAYER_FAILED_QUAD_TRANSFORM, |
| 32 CA_LAYER_FAILED_QUAD_CLIPPING, | 32 CA_LAYER_FAILED_QUAD_CLIPPING, |
| 33 CA_LAYER_FAILED_DEBUG_BORDER, | 33 CA_LAYER_FAILED_DEBUG_BORDER, |
| 34 CA_LAYER_FAILED_PICTURE_CONTENT, | 34 CA_LAYER_FAILED_PICTURE_CONTENT, |
| 35 CA_LAYER_FAILED_RENDER_PASS, | 35 CA_LAYER_FAILED_RENDER_PASS, |
| 36 CA_LAYER_FAILED_SURFACE_CONTENT, | 36 CA_LAYER_FAILED_SURFACE_CONTENT, |
| 37 CA_LAYER_FAILED_YUV_VIDEO_CONTENT, | 37 CA_LAYER_FAILED_YUV_VIDEO_CONTENT, |
| 38 CA_LAYER_FAILED_Y_VIDEO_CONTENT, |
| 38 CA_LAYER_FAILED_COUNT, | 39 CA_LAYER_FAILED_COUNT, |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 CALayerResult FromStreamVideoQuad(ResourceProvider* resource_provider, | 42 CALayerResult FromStreamVideoQuad(ResourceProvider* resource_provider, |
| 42 const StreamVideoDrawQuad* quad, | 43 const StreamVideoDrawQuad* quad, |
| 43 CALayerOverlay* ca_layer_overlay) { | 44 CALayerOverlay* ca_layer_overlay) { |
| 44 unsigned resource_id = quad->resource_id(); | 45 unsigned resource_id = quad->resource_id(); |
| 45 if (!resource_provider->IsOverlayCandidate(resource_id)) | 46 if (!resource_provider->IsOverlayCandidate(resource_id)) |
| 46 return CA_LAYER_FAILED_STREAM_VIDEO_NOT_CANDIDATE; | 47 return CA_LAYER_FAILED_STREAM_VIDEO_NOT_CANDIDATE; |
| 47 ca_layer_overlay->contents_resource_id = resource_id; | 48 ca_layer_overlay->contents_resource_id = resource_id; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 case DrawQuad::DEBUG_BORDER: | 161 case DrawQuad::DEBUG_BORDER: |
| 161 return CA_LAYER_FAILED_DEBUG_BORDER; | 162 return CA_LAYER_FAILED_DEBUG_BORDER; |
| 162 case DrawQuad::PICTURE_CONTENT: | 163 case DrawQuad::PICTURE_CONTENT: |
| 163 return CA_LAYER_FAILED_PICTURE_CONTENT; | 164 return CA_LAYER_FAILED_PICTURE_CONTENT; |
| 164 case DrawQuad::RENDER_PASS: | 165 case DrawQuad::RENDER_PASS: |
| 165 return CA_LAYER_FAILED_RENDER_PASS; | 166 return CA_LAYER_FAILED_RENDER_PASS; |
| 166 case DrawQuad::SURFACE_CONTENT: | 167 case DrawQuad::SURFACE_CONTENT: |
| 167 return CA_LAYER_FAILED_SURFACE_CONTENT; | 168 return CA_LAYER_FAILED_SURFACE_CONTENT; |
| 168 case DrawQuad::YUV_VIDEO_CONTENT: | 169 case DrawQuad::YUV_VIDEO_CONTENT: |
| 169 return CA_LAYER_FAILED_YUV_VIDEO_CONTENT; | 170 return CA_LAYER_FAILED_YUV_VIDEO_CONTENT; |
| 171 case DrawQuad::Y_VIDEO_CONTENT: |
| 172 return CA_LAYER_FAILED_Y_VIDEO_CONTENT; |
| 170 default: | 173 default: |
| 171 break; | 174 break; |
| 172 } | 175 } |
| 173 | 176 |
| 174 return CA_LAYER_FAILED_UNKNOWN; | 177 return CA_LAYER_FAILED_UNKNOWN; |
| 175 } | 178 } |
| 176 | 179 |
| 177 } // namespace | 180 } // namespace |
| 178 | 181 |
| 179 CALayerOverlay::CALayerOverlay() : filter(GL_LINEAR) {} | 182 CALayerOverlay::CALayerOverlay() : filter(GL_LINEAR) {} |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 CA_LAYER_FAILED_COUNT); | 227 CA_LAYER_FAILED_COUNT); |
| 225 | 228 |
| 226 if (result != CA_LAYER_SUCCESS) { | 229 if (result != CA_LAYER_SUCCESS) { |
| 227 ca_layer_overlays->clear(); | 230 ca_layer_overlays->clear(); |
| 228 return false; | 231 return false; |
| 229 } | 232 } |
| 230 return true; | 233 return true; |
| 231 } | 234 } |
| 232 | 235 |
| 233 } // namespace cc | 236 } // namespace cc |
| OLD | NEW |