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

Side by Side Diff: content/shell/renderer/webkit_test_runner.cc

Issue 191333002: stop using deprecated SkBitmap::Config -- use SkColorType instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | 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) 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 #include "content/shell/renderer/webkit_test_runner.h" 5 #include "content/shell/renderer/webkit_test_runner.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <clocale> 8 #include <clocale>
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 uint32_t* row = bitmap->getAddr32(0, y); 108 uint32_t* row = bitmap->getAddr32(0, y);
109 for (int x = 0; x < bitmap->width(); ++x) 109 for (int x = 0; x < bitmap->width(); ++x)
110 row[x] |= 0xFF000000; // Set alpha bits to 1. 110 row[x] |= 0xFF000000; // Set alpha bits to 1.
111 } 111 }
112 } 112 }
113 #endif 113 #endif
114 114
115 void CopyCanvasToBitmap(SkCanvas* canvas, SkBitmap* snapshot) { 115 void CopyCanvasToBitmap(SkCanvas* canvas, SkBitmap* snapshot) {
116 SkBaseDevice* device = skia::GetTopDevice(*canvas); 116 SkBaseDevice* device = skia::GetTopDevice(*canvas);
117 const SkBitmap& bitmap = device->accessBitmap(false); 117 const SkBitmap& bitmap = device->accessBitmap(false);
118 const bool success = bitmap.copyTo(snapshot, SkBitmap::kARGB_8888_Config); 118 const bool success = bitmap.copyTo(snapshot, kPMColor_SkColorType);
119 DCHECK(success); 119 DCHECK(success);
120 120
121 #if !defined(OS_MACOSX) 121 #if !defined(OS_MACOSX)
122 // Only the expected PNGs for Mac have a valid alpha channel. 122 // Only the expected PNGs for Mac have a valid alpha channel.
123 if (!CommandLine::ForCurrentProcess()->HasSwitch( 123 if (!CommandLine::ForCurrentProcess()->HasSwitch(
124 switches::kEnableOverlayFullscreenVideo)) 124 switches::kEnableOverlayFullscreenVideo))
125 MakeBitmapOpaque(snapshot); 125 MakeBitmapOpaque(snapshot);
126 #endif 126 #endif
127 } 127 }
128 128
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); 724 WebFrame* main_frame = render_view()->GetWebView()->mainFrame();
725 DCHECK_EQ(GURL(kAboutBlankURL), GURL(main_frame->document().url())); 725 DCHECK_EQ(GURL(kAboutBlankURL), GURL(main_frame->document().url()));
726 DCHECK(!main_frame->isLoading()); 726 DCHECK(!main_frame->isLoading());
727 727
728 LeakDetectionResult result = leak_detector_->TryLeakDetection( 728 LeakDetectionResult result = leak_detector_->TryLeakDetection(
729 render_view()->GetWebView()->mainFrame()); 729 render_view()->GetWebView()->mainFrame());
730 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), result)); 730 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), result));
731 } 731 }
732 732
733 } // namespace content 733 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698