diff options
author | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-01 15:43:43 +0000 |
---|---|---|
committer | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-01 15:43:43 +0000 |
commit | d19780b1c2e9f11c898163d2b4e1d5c1bc6a1108 (patch) | |
tree | cbfc6fcf8a37846a62f7abc5b043ee2da5f2971d /chrome | |
parent | b3eb62f5f1412519d60b6daee4f32c7e701845c8 (diff) | |
download | chromium_src-d19780b1c2e9f11c898163d2b4e1d5c1bc6a1108.zip chromium_src-d19780b1c2e9f11c898163d2b4e1d5c1bc6a1108.tar.gz chromium_src-d19780b1c2e9f11c898163d2b4e1d5c1bc6a1108.tar.bz2 |
Fix the progress animation to get displayed at the original size and not squished.
The progress animation was showing up squished vertically to about 10 pixels on linux, and to
fix that we now create bitmaps with the proper colour depth ourselves and draw the animation
frames onto it instead of using the built-in method.
BUG=53598
TEST=manual, test that the speech recognition progress animation shows up as expected and not squished.
Review URL: http://codereview.chromium.org/3576006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61178 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/speech/speech_input_bubble.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/speech/speech_input_bubble.cc b/chrome/browser/speech/speech_input_bubble.cc index eaa6bfe..44704dc 100644 --- a/chrome/browser/speech/speech_input_bubble.cc +++ b/chrome/browser/speech/speech_input_bubble.cc @@ -61,10 +61,16 @@ SpeechInputBubbleBase::SpeechInputBubbleBase() // horizontal/wide image. Each animation frame is square in shape within the // sprite. int frame_size = spinner_->height(); - for (int x = 0; x < spinner_->width(); x += frame_size) { + SkRect dst_rect(SkRect::MakeWH(SkIntToScalar(frame_size), + SkIntToScalar(frame_size))); + for (SkIRect src_rect(SkIRect::MakeWH(frame_size, frame_size)); + src_rect.fLeft < spinner_->width(); + src_rect.offset(frame_size, 0)) { SkBitmap frame; - spinner_->extractSubset(&frame, - SkIRect::MakeXYWH(x, 0, frame_size, frame_size)); + frame.setConfig(SkBitmap::kARGB_8888_Config, frame_size, frame_size); + frame.allocPixels(); + SkCanvas canvas(frame); + canvas.drawBitmapRect(*spinner_, &src_rect, dst_rect); animation_frames_.push_back(frame); } } |