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

Side by Side Diff: src/animator/SkSnapshot.cpp

Issue 355193006: stop calling SkCanvas::getDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkTypes.h" 10 #include "SkTypes.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 num[1] = (char) (num[1] + fSeqVal / 10 % 10); 53 num[1] = (char) (num[1] + fSeqVal / 10 % 10);
54 num[2] = (char) (num[2] + fSeqVal % 10); 54 num[2] = (char) (num[2] + fSeqVal % 10);
55 name.append(num); 55 name.append(num);
56 if (++fSeqVal > 999) 56 if (++fSeqVal > 999)
57 sequence = false; 57 sequence = false;
58 } 58 }
59 if (type == SkImageEncoder::kJPEG_Type) 59 if (type == SkImageEncoder::kJPEG_Type)
60 name.append(".jpg"); 60 name.append(".jpg");
61 else if (type == SkImageEncoder::kPNG_Type) 61 else if (type == SkImageEncoder::kPNG_Type)
62 name.append(".png"); 62 name.append(".png");
63 encoder->encodeFile(name.c_str(), 63
64 maker.fCanvas->getDevice()->accessBitmap(false), 64 SkBitmap pixels;
65 SkScalarFloorToInt(quality)); 65 pixels.allocPixels(maker.fCanvas->imageInfo());
66 maker.fCanvas->readPixels(&pixels, 0, 0);
67 encoder->encodeFile(name.c_str(), pixels, SkScalarFloorToInt(quality));
66 return false; 68 return false;
67 } 69 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698