| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/tab_contents/thumbnail_generator.h" | 5 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 backing_store->size().height(), true)) | 122 backing_store->size().height(), true)) |
| 123 return result; | 123 return result; |
| 124 GetBitmapForBackingStore(backing_store, &temp_canvas); | 124 GetBitmapForBackingStore(backing_store, &temp_canvas); |
| 125 | 125 |
| 126 // Get the bitmap out of the canvas and resample it. It would be nice if this | 126 // Get the bitmap out of the canvas and resample it. It would be nice if this |
| 127 // whole Windows-specific block could be put into a function, but the memory | 127 // whole Windows-specific block could be put into a function, but the memory |
| 128 // management wouldn't work out because the bitmap is a PlatformDevice which | 128 // management wouldn't work out because the bitmap is a PlatformDevice which |
| 129 // can't actually be copied. | 129 // can't actually be copied. |
| 130 const SkBitmap& bmp = temp_canvas.getTopPlatformDevice().accessBitmap(false); | 130 const SkBitmap& bmp = temp_canvas.getTopPlatformDevice().accessBitmap(false); |
| 131 | 131 |
| 132 #elif defined(OS_LINUX) | 132 #elif defined(USE_X11) |
| 133 SkBitmap bmp = backing_store->PaintRectToBitmap( | 133 SkBitmap bmp = backing_store->PaintRectToBitmap( |
| 134 gfx::Rect(0, 0, | 134 gfx::Rect(0, 0, |
| 135 backing_store->size().width(), backing_store->size().height())); | 135 backing_store->size().width(), backing_store->size().height())); |
| 136 | 136 |
| 137 #elif defined(OS_MACOSX) | 137 #elif defined(OS_MACOSX) |
| 138 SkBitmap bmp; | 138 SkBitmap bmp; |
| 139 NOTIMPLEMENTED(); | 139 NOTIMPLEMENTED(); |
| 140 #endif | 140 #endif |
| 141 | 141 |
| 142 result = skia::ImageOperations::DownsampleByTwoUntilSize( | 142 result = skia::ImageOperations::DownsampleByTwoUntilSize( |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 &ThumbnailGenerator::ShownDelayHandler); | 356 &ThumbnailGenerator::ShownDelayHandler); |
| 357 } | 357 } |
| 358 } | 358 } |
| 359 | 359 |
| 360 void ThumbnailGenerator::EraseHostFromShownList(RenderWidgetHost* widget) { | 360 void ThumbnailGenerator::EraseHostFromShownList(RenderWidgetHost* widget) { |
| 361 std::vector<RenderWidgetHost*>::iterator found = | 361 std::vector<RenderWidgetHost*>::iterator found = |
| 362 std::find(shown_hosts_.begin(), shown_hosts_.end(), widget); | 362 std::find(shown_hosts_.begin(), shown_hosts_.end(), widget); |
| 363 if (found != shown_hosts_.end()) | 363 if (found != shown_hosts_.end()) |
| 364 shown_hosts_.erase(found); | 364 shown_hosts_.erase(found); |
| 365 } | 365 } |
| OLD | NEW |