Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: gfx/skbitmap_operations.h

Issue 661237: This adds in the ability for Chrome to generate windows with snapshots of all... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/render_widget.cc ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef APP_GFX_SKBITMAP_OPERATIONS_H_ 5 #ifndef APP_GFX_SKBITMAP_OPERATIONS_H_
6 #define APP_GFX_SKBITMAP_OPERATIONS_H_ 6 #define APP_GFX_SKBITMAP_OPERATIONS_H_
7 7
8 #include "gfx/color_utils.h" 8 #include "gfx/color_utils.h"
9 #include "testing/gtest/include/gtest/gtest_prod.h" 9 #include "testing/gtest/include/gtest/gtest_prod.h"
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 int dst_w, int dst_h); 71 int dst_w, int dst_h);
72 72
73 // Iteratively downsamples by 2 until the bitmap is no smaller than the 73 // Iteratively downsamples by 2 until the bitmap is no smaller than the
74 // input size. The normal use of this is to downsample the bitmap "close" to 74 // input size. The normal use of this is to downsample the bitmap "close" to
75 // the final size, and then use traditional resampling on the result. 75 // the final size, and then use traditional resampling on the result.
76 // Because the bitmap will be closer to the final size, it will be faster, 76 // Because the bitmap will be closer to the final size, it will be faster,
77 // and linear interpolation will generally work well as a second step. 77 // and linear interpolation will generally work well as a second step.
78 static SkBitmap DownsampleByTwoUntilSize(const SkBitmap& bitmap, 78 static SkBitmap DownsampleByTwoUntilSize(const SkBitmap& bitmap,
79 int min_w, int min_h); 79 int min_w, int min_h);
80 80
81 private:
82 SkBitmapOperations(); // Class for scoping only.
83
84 // Makes a bitmap half has large in each direction by averaging groups of 81 // Makes a bitmap half has large in each direction by averaging groups of
85 // 4 pixels. This is one step in generating a mipmap. 82 // 4 pixels. This is one step in generating a mipmap.
86 static SkBitmap DownsampleByTwo(const SkBitmap& bitmap); 83 static SkBitmap DownsampleByTwo(const SkBitmap& bitmap);
84 private:
85 SkBitmapOperations(); // Class for scoping only.
87 86
88 FRIEND_TEST(SkBitmapOperationsTest, DownsampleByTwo); 87 FRIEND_TEST(SkBitmapOperationsTest, DownsampleByTwo);
89 FRIEND_TEST(SkBitmapOperationsTest, DownsampleByTwoSmall); 88 FRIEND_TEST(SkBitmapOperationsTest, DownsampleByTwoSmall);
90 }; 89 };
91 90
92 #endif // APP_GFX_SKBITMAP_OPERATIONS_H_ 91 #endif // APP_GFX_SKBITMAP_OPERATIONS_H_
93
OLDNEW
« no previous file with comments | « chrome/renderer/render_widget.cc ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698