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/resources/raster_worker_pool.h" | 5 #include "cc/resources/raster_worker_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 static bool IsSupportedPlaybackToMemoryFormat(ResourceFormat format) { | 199 static bool IsSupportedPlaybackToMemoryFormat(ResourceFormat format) { |
200 switch (format) { | 200 switch (format) { |
201 case RGBA_4444: | 201 case RGBA_4444: |
202 case RGBA_8888: | 202 case RGBA_8888: |
203 case BGRA_8888: | 203 case BGRA_8888: |
204 return true; | 204 return true; |
205 case ALPHA_8: | 205 case ALPHA_8: |
206 case LUMINANCE_8: | 206 case LUMINANCE_8: |
207 case RGB_565: | 207 case RGB_565: |
208 case ETC1: | 208 case ETC1: |
| 209 case RED_8: |
209 return false; | 210 return false; |
210 } | 211 } |
211 NOTREACHED(); | 212 NOTREACHED(); |
212 return false; | 213 return false; |
213 } | 214 } |
214 | 215 |
215 // static | 216 // static |
216 void RasterWorkerPool::PlaybackToMemory(void* memory, | 217 void RasterWorkerPool::PlaybackToMemory(void* memory, |
217 ResourceFormat format, | 218 ResourceFormat format, |
218 const gfx::Size& size, | 219 const gfx::Size& size, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the | 257 // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the |
257 // bitmap data. There will be no need to call SkAlign4 once crbug.com/293728 | 258 // bitmap data. There will be no need to call SkAlign4 once crbug.com/293728 |
258 // is fixed. | 259 // is fixed. |
259 const size_t dst_row_bytes = SkAlign4(dst_info.minRowBytes()); | 260 const size_t dst_row_bytes = SkAlign4(dst_info.minRowBytes()); |
260 DCHECK_EQ(0u, dst_row_bytes % 4); | 261 DCHECK_EQ(0u, dst_row_bytes % 4); |
261 bool success = canvas->readPixels(dst_info, memory, dst_row_bytes, 0, 0); | 262 bool success = canvas->readPixels(dst_info, memory, dst_row_bytes, 0, 0); |
262 DCHECK_EQ(true, success); | 263 DCHECK_EQ(true, success); |
263 } | 264 } |
264 | 265 |
265 } // namespace cc | 266 } // namespace cc |
OLD | NEW |