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

Side by Side Diff: chrome/renderer/render_widget_browsertest.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 years, 1 month 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') | chrome/renderer/render_widget_fullscreen.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/surface/transport_dib.h" 5 #include "app/surface/transport_dib.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/ref_counted_memory.h" 9 #include "base/ref_counted_memory.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if (argb_color == *bitmap.getAddr32(x, y)) { 121 if (argb_color == *bitmap.getAddr32(x, y)) {
122 return true; 122 return true;
123 } 123 }
124 } 124 }
125 } 125 }
126 return false; 126 return false;
127 } 127 }
128 128
129 void RenderWidgetTest::OutputBitmapToFile(const SkBitmap& bitmap, 129 void RenderWidgetTest::OutputBitmapToFile(const SkBitmap& bitmap,
130 const FilePath& file_path) { 130 const FilePath& file_path) {
131 scoped_refptr<RefCountedBytes> bitmap_data = new RefCountedBytes(); 131 scoped_refptr<RefCountedBytes> bitmap_data(new RefCountedBytes());
132 SkAutoLockPixels lock(bitmap); 132 SkAutoLockPixels lock(bitmap);
133 ASSERT_TRUE(gfx::JPEGCodec::Encode( 133 ASSERT_TRUE(gfx::JPEGCodec::Encode(
134 reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)), 134 reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)),
135 gfx::JPEGCodec::FORMAT_BGRA, 135 gfx::JPEGCodec::FORMAT_BGRA,
136 bitmap.width(), 136 bitmap.width(),
137 bitmap.height(), 137 bitmap.height(),
138 static_cast<int>(bitmap.rowBytes()), 138 static_cast<int>(bitmap.rowBytes()),
139 90 /* quality */, 139 90 /* quality */,
140 &bitmap_data->data)); 140 &bitmap_data->data));
141 ASSERT_LT(0, file_util::WriteFile( 141 ASSERT_LT(0, file_util::WriteFile(
142 file_path, 142 file_path,
143 reinterpret_cast<const char*>(bitmap_data->front()), 143 reinterpret_cast<const char*>(bitmap_data->front()),
144 bitmap_data->size())); 144 bitmap_data->size()));
145 } 145 }
146 146
147 TEST_F(RenderWidgetTest, OnMsgPaintAtSize) { 147 TEST_F(RenderWidgetTest, OnMsgPaintAtSize) {
148 TestResizeAndPaint(); 148 TestResizeAndPaint();
149 } 149 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_widget.cc ('k') | chrome/renderer/render_widget_fullscreen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698