| 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/tile_task_worker_pool.h" | 5 #include "cc/raster/tile_task_worker_pool.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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 std::unique_ptr<TextureCompressor> texture_compressor = | 115 std::unique_ptr<TextureCompressor> texture_compressor = |
| 116 TextureCompressor::Create(TextureCompressor::kFormatETC1); | 116 TextureCompressor::Create(TextureCompressor::kFormatETC1); |
| 117 texture_compressor->Compress(reinterpret_cast<const uint8_t*>( | 117 texture_compressor->Compress(reinterpret_cast<const uint8_t*>( |
| 118 surface->peekPixels(nullptr, nullptr)), | 118 surface->peekPixels(nullptr, nullptr)), |
| 119 reinterpret_cast<uint8_t*>(memory), | 119 reinterpret_cast<uint8_t*>(memory), |
| 120 size.width(), size.height(), | 120 size.width(), size.height(), |
| 121 TextureCompressor::kQualityHigh); | 121 TextureCompressor::kQualityHigh); |
| 122 } else { | 122 } else { |
| 123 TRACE_EVENT0("cc", | 123 TRACE_EVENT0("cc", |
| 124 "TileTaskWorkerPool::PlaybackToMemory::ConvertRGBA4444"); | 124 "TileTaskWorkerPool::PlaybackToMemory::ConvertRGBA4444"); |
| 125 SkImageInfo dst_info = SkImageInfo::Make( | 125 SkImageInfo dst_info = |
| 126 info.width(), info.height(), ResourceFormatToSkColorType(format), | 126 SkImageInfo::Make(info.width(), info.height(), |
| 127 info.alphaType(), info.profileType()); | 127 ResourceFormatToClosestSkColorType(format), |
| 128 info.alphaType(), info.profileType()); |
| 128 bool rv = surface->readPixels(dst_info, memory, stride, 0, 0); | 129 bool rv = surface->readPixels(dst_info, memory, stride, 0, 0); |
| 129 DCHECK(rv); | 130 DCHECK(rv); |
| 130 } | 131 } |
| 131 return; | 132 return; |
| 132 } | 133 } |
| 133 case ALPHA_8: | 134 case ALPHA_8: |
| 134 case LUMINANCE_8: | 135 case LUMINANCE_8: |
| 135 case RGB_565: | 136 case RGB_565: |
| 136 case RED_8: | 137 case RED_8: |
| 137 case LUMINANCE_F16: | 138 case LUMINANCE_F16: |
| 138 NOTREACHED(); | 139 NOTREACHED(); |
| 139 return; | 140 return; |
| 140 } | 141 } |
| 141 | 142 |
| 142 NOTREACHED(); | 143 NOTREACHED(); |
| 143 } | 144 } |
| 144 | 145 |
| 145 } // namespace cc | 146 } // namespace cc |
| OLD | NEW |