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 16 matching lines...) Expand all Loading... |
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 LUMINANCE_F16: | 36 case LUMINANCE_F16: |
| 37 case RG_88: |
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 |
46 void RasterBufferProvider::PlaybackToMemory( | 47 void RasterBufferProvider::PlaybackToMemory( |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 bool rv = surface->readPixels(dst_info, memory, stride, 0, 0); | 114 bool rv = surface->readPixels(dst_info, memory, stride, 0, 0); |
114 DCHECK(rv); | 115 DCHECK(rv); |
115 } | 116 } |
116 return; | 117 return; |
117 } | 118 } |
118 case ALPHA_8: | 119 case ALPHA_8: |
119 case LUMINANCE_8: | 120 case LUMINANCE_8: |
120 case RGB_565: | 121 case RGB_565: |
121 case RED_8: | 122 case RED_8: |
122 case LUMINANCE_F16: | 123 case LUMINANCE_F16: |
| 124 case RG_88: |
123 NOTREACHED(); | 125 NOTREACHED(); |
124 return; | 126 return; |
125 } | 127 } |
126 | 128 |
127 NOTREACHED(); | 129 NOTREACHED(); |
128 } | 130 } |
129 | 131 |
130 bool RasterBufferProvider::ResourceFormatRequiresSwizzle( | 132 bool RasterBufferProvider::ResourceFormatRequiresSwizzle( |
131 ResourceFormat format) { | 133 ResourceFormat format) { |
132 switch (format) { | 134 switch (format) { |
133 case RGBA_8888: | 135 case RGBA_8888: |
134 case BGRA_8888: | 136 case BGRA_8888: |
135 // Initialize resource using the preferred PlatformColor component | 137 // Initialize resource using the preferred PlatformColor component |
136 // order and swizzle in the shader instead of in software. | 138 // order and swizzle in the shader instead of in software. |
137 return !PlatformColor::SameComponentOrder(format); | 139 return !PlatformColor::SameComponentOrder(format); |
138 case RGBA_4444: | 140 case RGBA_4444: |
139 case ETC1: | 141 case ETC1: |
140 case ALPHA_8: | 142 case ALPHA_8: |
141 case LUMINANCE_8: | 143 case LUMINANCE_8: |
142 case RGB_565: | 144 case RGB_565: |
143 case RED_8: | 145 case RED_8: |
144 case LUMINANCE_F16: | 146 case LUMINANCE_F16: |
| 147 case RG_88: |
145 return false; | 148 return false; |
146 } | 149 } |
147 NOTREACHED(); | 150 NOTREACHED(); |
148 return false; | 151 return false; |
149 } | 152 } |
150 | 153 |
151 } // namespace cc | 154 } // namespace cc |
OLD | NEW |