OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "chrome/browser/ui/cocoa/tabpose_window.h" | 5 #import "chrome/browser/ui/cocoa/tabpose_window.h" |
6 | 6 |
7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 323 } |
324 | 324 |
325 if (draw_backing_store) { | 325 if (draw_backing_store) { |
326 // Backing store 'cache' hit! | 326 // Backing store 'cache' hit! |
327 // TODO(thakis): Add a sublayer for each accelerated surface in the rwhv. | 327 // TODO(thakis): Add a sublayer for each accelerated surface in the rwhv. |
328 // Until then, accelerated layers (CoreAnimation NPAPI plugins, compositor) | 328 // Until then, accelerated layers (CoreAnimation NPAPI plugins, compositor) |
329 // won't show up in tabpose. | 329 // won't show up in tabpose. |
330 rwh->CopyFromBackingStoreToCGContext(destRect, context); | 330 rwh->CopyFromBackingStoreToCGContext(destRect, context); |
331 } else if (thumbnail_) { | 331 } else if (thumbnail_) { |
332 // No cache hit, but the renderer returned a thumbnail to us. | 332 // No cache hit, but the renderer returned a thumbnail to us. |
333 gfx::ScopedCGContextSaveGState CGContextSaveGState(context); | 333 gfx::ScopedCGContextSaveGState save_gstate(context); |
334 CGContextSetInterpolationQuality(context, kCGInterpolationHigh); | 334 CGContextSetInterpolationQuality(context, kCGInterpolationHigh); |
335 CGContextDrawImage(context, destRect, thumbnail_.get()); | 335 CGContextDrawImage(context, destRect, thumbnail_.get()); |
336 } | 336 } |
337 } | 337 } |
338 | 338 |
339 @end | 339 @end |
340 | 340 |
341 // Given the number |n| of tiles with a desired aspect ratio of |a| and a | 341 // Given the number |n| of tiles with a desired aspect ratio of |a| and a |
342 // desired distance |dx|, |dy| between tiles, returns how many tiles fit | 342 // desired distance |dx|, |dy| between tiles, returns how many tiles fit |
343 // vertically into a rectangle with the dimensions |w_c|, |h_c|. This returns | 343 // vertically into a rectangle with the dimensions |w_c|, |h_c|. This returns |
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 tile.set_tab_contents(contents); | 1665 tile.set_tab_contents(contents); |
1666 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index]; | 1666 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index]; |
1667 [thumbLayer setTabContents:contents]; | 1667 [thumbLayer setTabContents:contents]; |
1668 } | 1668 } |
1669 | 1669 |
1670 - (void)tabStripModelDeleted { | 1670 - (void)tabStripModelDeleted { |
1671 [self close]; | 1671 [self close]; |
1672 } | 1672 } |
1673 | 1673 |
1674 @end | 1674 @end |
OLD | NEW |