| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/raster/raster_buffer_provider.h" | 5 #include "cc/raster/raster_buffer_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/playback/raster_source.h" | 10 #include "cc/playback/raster_source.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 switch (format) { | 26 switch (format) { |
| 27 case RGBA_4444: | 27 case RGBA_4444: |
| 28 case RGBA_8888: | 28 case RGBA_8888: |
| 29 case BGRA_8888: | 29 case BGRA_8888: |
| 30 case ETC1: | 30 case ETC1: |
| 31 return true; | 31 return true; |
| 32 case ALPHA_8: | 32 case ALPHA_8: |
| 33 case LUMINANCE_8: | 33 case LUMINANCE_8: |
| 34 case RGB_565: | 34 case RGB_565: |
| 35 case RED_8: | 35 case RED_8: |
| 36 case RG_88: |
| 36 case LUMINANCE_F16: | 37 case LUMINANCE_F16: |
| 37 return false; | 38 return false; |
| 38 } | 39 } |
| 39 NOTREACHED(); | 40 NOTREACHED(); |
| 40 return false; | 41 return false; |
| 41 } | 42 } |
| 42 | 43 |
| 43 } // anonymous namespace | 44 } // anonymous namespace |
| 44 | 45 |
| 45 // static | 46 // static |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 info.makeColorType(ResourceFormatToClosestSkColorType(format)); | 114 info.makeColorType(ResourceFormatToClosestSkColorType(format)); |
| 114 bool rv = surface->readPixels(dst_info, memory, stride, 0, 0); | 115 bool rv = surface->readPixels(dst_info, memory, stride, 0, 0); |
| 115 DCHECK(rv); | 116 DCHECK(rv); |
| 116 } | 117 } |
| 117 return; | 118 return; |
| 118 } | 119 } |
| 119 case ALPHA_8: | 120 case ALPHA_8: |
| 120 case LUMINANCE_8: | 121 case LUMINANCE_8: |
| 121 case RGB_565: | 122 case RGB_565: |
| 122 case RED_8: | 123 case RED_8: |
| 124 case RG_88: |
| 123 case LUMINANCE_F16: | 125 case LUMINANCE_F16: |
| 124 NOTREACHED(); | 126 NOTREACHED(); |
| 125 return; | 127 return; |
| 126 } | 128 } |
| 127 | 129 |
| 128 NOTREACHED(); | 130 NOTREACHED(); |
| 129 } | 131 } |
| 130 | 132 |
| 131 bool RasterBufferProvider::ResourceFormatRequiresSwizzle( | 133 bool RasterBufferProvider::ResourceFormatRequiresSwizzle( |
| 132 ResourceFormat format) { | 134 ResourceFormat format) { |
| 133 switch (format) { | 135 switch (format) { |
| 134 case RGBA_8888: | 136 case RGBA_8888: |
| 135 case BGRA_8888: | 137 case BGRA_8888: |
| 136 // Initialize resource using the preferred PlatformColor component | 138 // Initialize resource using the preferred PlatformColor component |
| 137 // order and swizzle in the shader instead of in software. | 139 // order and swizzle in the shader instead of in software. |
| 138 return !PlatformColor::SameComponentOrder(format); | 140 return !PlatformColor::SameComponentOrder(format); |
| 139 case RGBA_4444: | 141 case RGBA_4444: |
| 140 case ETC1: | 142 case ETC1: |
| 141 case ALPHA_8: | 143 case ALPHA_8: |
| 142 case LUMINANCE_8: | 144 case LUMINANCE_8: |
| 143 case RGB_565: | 145 case RGB_565: |
| 144 case RED_8: | 146 case RED_8: |
| 147 case RG_88: |
| 145 case LUMINANCE_F16: | 148 case LUMINANCE_F16: |
| 146 return false; | 149 return false; |
| 147 } | 150 } |
| 148 NOTREACHED(); | 151 NOTREACHED(); |
| 149 return false; | 152 return false; |
| 150 } | 153 } |
| 151 | 154 |
| 152 } // namespace cc | 155 } // namespace cc |
| OLD | NEW |