OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/tiles/gpu_image_decode_controller.h" | 5 #include "cc/tiles/gpu_image_decode_controller.h" |
6 | 6 |
7 #include <inttypes.h> | 7 #include <inttypes.h> |
8 | 8 |
9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
10 #include "base/memory/discardable_memory_allocator.h" | 10 #include "base/memory/discardable_memory_allocator.h" |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 // no need to special case that as an optimization. | 966 // no need to special case that as an optimization. |
967 if (!draw_image.image()->scalePixels( | 967 if (!draw_image.image()->scalePixels( |
968 image_pixmap, CalculateUploadScaleFilterQuality(draw_image), | 968 image_pixmap, CalculateUploadScaleFilterQuality(draw_image), |
969 SkImage::kDisallow_CachingHint)) { | 969 SkImage::kDisallow_CachingHint)) { |
970 backing_memory->Unlock(); | 970 backing_memory->Unlock(); |
971 backing_memory.reset(); | 971 backing_memory.reset(); |
972 } | 972 } |
973 break; | 973 break; |
974 } | 974 } |
975 case DecodedDataMode::GPU: { | 975 case DecodedDataMode::GPU: { |
976 // Params should not have changed since initial sizing. | 976 // TODO(crbug.com/649167): Params should not have changed since initial |
977 DCHECK(image_data->upload_params.fMatrix == draw_image.matrix()); | 977 // sizing. Somehow this still happens. We should investigate and re-add |
978 DCHECK_EQ(image_data->upload_params.fPreScaleMipLevel, | 978 // DCHECKs here to enforce this. |
979 CalculateUploadScaleMipLevel(draw_image)); | |
980 DCHECK_EQ(image_data->upload_params.fQuality, | |
981 CalculateUploadScaleFilterQuality(draw_image)); | |
982 | 979 |
983 if (!draw_image.image()->getDeferredTextureImageData( | 980 if (!draw_image.image()->getDeferredTextureImageData( |
984 *context_threadsafe_proxy_.get(), &image_data->upload_params, 1, | 981 *context_threadsafe_proxy_.get(), &image_data->upload_params, 1, |
985 backing_memory->data())) { | 982 backing_memory->data())) { |
986 backing_memory->Unlock(); | 983 backing_memory->Unlock(); |
987 backing_memory.reset(); | 984 backing_memory.reset(); |
988 } | 985 } |
989 break; | 986 break; |
990 } | 987 } |
991 } | 988 } |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 // TODO(tasak): free this component's caches as much as possible before | 1184 // TODO(tasak): free this component's caches as much as possible before |
1188 // suspending renderer. | 1185 // suspending renderer. |
1189 break; | 1186 break; |
1190 case base::MemoryState::UNKNOWN: | 1187 case base::MemoryState::UNKNOWN: |
1191 // NOT_REACHED. | 1188 // NOT_REACHED. |
1192 break; | 1189 break; |
1193 } | 1190 } |
1194 } | 1191 } |
1195 | 1192 |
1196 } // namespace cc | 1193 } // namespace cc |
OLD | NEW |