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

Side by Side Diff: chrome/browser/speech/speech_recognition_bubble.cc

Issue 12088111: replace kMultiply_Mode with kModulate_Mode (the former is deprecated). No functionality change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 "chrome/browser/speech/speech_recognition_bubble.h" 5 #include "chrome/browser/speech/speech_recognition_bubble.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 buffer_canvas.save(); 230 buffer_canvas.save();
231 const int kVolumeSteps = 12; 231 const int kVolumeSteps = 12;
232 SkScalar clip_right = 232 SkScalar clip_right =
233 (((1.0f - volume) * (width * (kVolumeSteps + 1))) - width) / kVolumeSteps; 233 (((1.0f - volume) * (width * (kVolumeSteps + 1))) - width) / kVolumeSteps;
234 buffer_canvas.clipRect(SkRect::MakeLTRB(0, 0, 234 buffer_canvas.clipRect(SkRect::MakeLTRB(0, 0,
235 SkIntToScalar(width) - clip_right, SkIntToScalar(height))); 235 SkIntToScalar(width) - clip_right, SkIntToScalar(height)));
236 buffer_canvas.drawBitmap( 236 buffer_canvas.drawBitmap(
237 image.GetRepresentation(scale_factor_).sk_bitmap(), 0, 0); 237 image.GetRepresentation(scale_factor_).sk_bitmap(), 0, 0);
238 buffer_canvas.restore(); 238 buffer_canvas.restore();
239 SkPaint multiply_paint; 239 SkPaint multiply_paint;
240 multiply_paint.setXfermode(SkXfermode::Create(SkXfermode::kMultiply_Mode)); 240 multiply_paint.setXfermode(SkXfermode::Create(SkXfermode::kModulate_Mode));
241 buffer_canvas.drawBitmap( 241 buffer_canvas.drawBitmap(
242 g_images.Get().mic_mask()->GetRepresentation(scale_factor_).sk_bitmap(), 242 g_images.Get().mic_mask()->GetRepresentation(scale_factor_).sk_bitmap(),
243 -clip_right, 0, &multiply_paint); 243 -clip_right, 0, &multiply_paint);
244 244
245 canvas->drawBitmap(*buffer_image_.get(), 0, 0); 245 canvas->drawBitmap(*buffer_image_.get(), 0, 0);
246 } 246 }
247 247
248 void SpeechRecognitionBubbleBase::SetInputVolume(float volume, 248 void SpeechRecognitionBubbleBase::SetInputVolume(float volume,
249 float noise_volume) { 249 float noise_volume) {
250 mic_image_->eraseARGB(0, 0, 0, 0); 250 mic_image_->eraseARGB(0, 0, 0, 0);
(...skipping 16 matching lines...) Expand all
267 } 267 }
268 268
269 void SpeechRecognitionBubbleBase::SetImage(const gfx::ImageSkia& image) { 269 void SpeechRecognitionBubbleBase::SetImage(const gfx::ImageSkia& image) {
270 icon_image_ = image; 270 icon_image_ = image;
271 UpdateImage(); 271 UpdateImage();
272 } 272 }
273 273
274 gfx::ImageSkia SpeechRecognitionBubbleBase::icon_image() { 274 gfx::ImageSkia SpeechRecognitionBubbleBase::icon_image() {
275 return icon_image_; 275 return icon_image_;
276 } 276 }
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