OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/android/thumbnail/thumbnail_cache.h" | 5 #include "chrome/browser/android/thumbnail/thumbnail_cache.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/android/path_utils.h" | 10 #include "base/android/path_utils.h" |
11 #include "base/big_endian.h" | 11 #include "base/big_endian.h" |
12 #include "base/files/file.h" | 12 #include "base/files/file.h" |
13 #include "base/files/file_enumerator.h" | 13 #include "base/files/file_enumerator.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/threading/worker_pool.h" | 17 #include "base/threading/worker_pool.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "build/build_config.h" |
19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
20 #include "third_party/android_opengl/etc1/etc1.h" | 21 #include "third_party/android_opengl/etc1/etc1.h" |
21 #include "third_party/skia/include/core/SkBitmap.h" | 22 #include "third_party/skia/include/core/SkBitmap.h" |
22 #include "third_party/skia/include/core/SkCanvas.h" | 23 #include "third_party/skia/include/core/SkCanvas.h" |
23 #include "third_party/skia/include/core/SkData.h" | 24 #include "third_party/skia/include/core/SkData.h" |
24 #include "third_party/skia/include/core/SkMallocPixelRef.h" | 25 #include "third_party/skia/include/core/SkMallocPixelRef.h" |
25 #include "third_party/skia/include/core/SkPixelRef.h" | 26 #include "third_party/skia/include/core/SkPixelRef.h" |
26 #include "ui/android/resources/ui_resource_provider.h" | 27 #include "ui/android/resources/ui_resource_provider.h" |
27 #include "ui/gfx/android/device_display_info.h" | 28 #include "ui/gfx/android/device_display_info.h" |
28 #include "ui/gfx/geometry/size_conversions.h" | 29 #include "ui/gfx/geometry/size_conversions.h" |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 dst_bitmap.eraseColor(0); | 930 dst_bitmap.eraseColor(0); |
930 SkAutoLockPixels dst_bitmap_lock(dst_bitmap); | 931 SkAutoLockPixels dst_bitmap_lock(dst_bitmap); |
931 | 932 |
932 SkCanvas canvas(dst_bitmap); | 933 SkCanvas canvas(dst_bitmap); |
933 canvas.scale(new_scale, new_scale); | 934 canvas.scale(new_scale, new_scale); |
934 canvas.drawBitmap(bitmap, 0, 0, NULL); | 935 canvas.drawBitmap(bitmap, 0, 0, NULL); |
935 dst_bitmap.setImmutable(); | 936 dst_bitmap.setImmutable(); |
936 | 937 |
937 return std::make_pair(dst_bitmap, new_scale * scale); | 938 return std::make_pair(dst_bitmap, new_scale * scale); |
938 } | 939 } |
OLD | NEW |