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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // playback rect passed to PlaybackToCanvas. crbug.com/519070 | 105 // playback rect passed to PlaybackToCanvas. crbug.com/519070 |
106 raster_source->PlaybackToCanvas(surface->getCanvas(), canvas_bitmap_rect, | 106 raster_source->PlaybackToCanvas(surface->getCanvas(), canvas_bitmap_rect, |
107 canvas_bitmap_rect, scale, | 107 canvas_bitmap_rect, scale, |
108 playback_settings); | 108 playback_settings); |
109 | 109 |
110 if (format == ETC1) { | 110 if (format == ETC1) { |
111 TRACE_EVENT0("cc", | 111 TRACE_EVENT0("cc", |
112 "TileTaskWorkerPool::PlaybackToMemory::CompressETC1"); | 112 "TileTaskWorkerPool::PlaybackToMemory::CompressETC1"); |
113 DCHECK_EQ(size.width() % 4, 0); | 113 DCHECK_EQ(size.width() % 4, 0); |
114 DCHECK_EQ(size.height() % 4, 0); | 114 DCHECK_EQ(size.height() % 4, 0); |
115 scoped_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 = SkImageInfo::Make( |
(...skipping 10 matching lines...) Expand all Loading... |
136 case RED_8: | 136 case RED_8: |
137 case LUMINANCE_F16: | 137 case LUMINANCE_F16: |
138 NOTREACHED(); | 138 NOTREACHED(); |
139 return; | 139 return; |
140 } | 140 } |
141 | 141 |
142 NOTREACHED(); | 142 NOTREACHED(); |
143 } | 143 } |
144 | 144 |
145 } // namespace cc | 145 } // namespace cc |
OLD | NEW |