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

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

Issue 1904673003: Rein in the use of SkDevice.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « samplecode/SampleTextAlpha.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 17 matching lines...) Expand all
28 DEFINE_GET_MEMBER(SkSnapshot); 28 DEFINE_GET_MEMBER(SkSnapshot);
29 29
30 SkSnapshot::SkSnapshot() 30 SkSnapshot::SkSnapshot()
31 { 31 {
32 quality = 100 * SK_Scalar1; 32 quality = 100 * SK_Scalar1;
33 type = (SkImageEncoder::Type) -1; 33 type = (SkImageEncoder::Type) -1;
34 sequence = false; 34 sequence = false;
35 fSeqVal = 0; 35 fSeqVal = 0;
36 } 36 }
37 37
38 #include "SkDevice.h"
39
40 bool SkSnapshot::draw(SkAnimateMaker& maker) { 38 bool SkSnapshot::draw(SkAnimateMaker& maker) {
41 SkASSERT(type >= 0); 39 SkASSERT(type >= 0);
42 SkASSERT(filename.size() > 0); 40 SkASSERT(filename.size() > 0);
43 SkImageEncoder* encoder = SkImageEncoder::Create((SkImageEncoder::Type) type ); 41 SkImageEncoder* encoder = SkImageEncoder::Create((SkImageEncoder::Type) type );
44 if (!encoder) { 42 if (!encoder) {
45 return false; 43 return false;
46 } 44 }
47 SkAutoTDelete<SkImageEncoder> ad(encoder); 45 SkAutoTDelete<SkImageEncoder> ad(encoder);
48 46
49 SkString name(filename); 47 SkString name(filename);
(...skipping 10 matching lines...) Expand all
60 name.append(".jpg"); 58 name.append(".jpg");
61 else if (type == SkImageEncoder::kPNG_Type) 59 else if (type == SkImageEncoder::kPNG_Type)
62 name.append(".png"); 60 name.append(".png");
63 61
64 SkBitmap pixels; 62 SkBitmap pixels;
65 pixels.allocPixels(maker.fCanvas->imageInfo()); 63 pixels.allocPixels(maker.fCanvas->imageInfo());
66 maker.fCanvas->readPixels(&pixels, 0, 0); 64 maker.fCanvas->readPixels(&pixels, 0, 0);
67 encoder->encodeFile(name.c_str(), pixels, SkScalarFloorToInt(quality)); 65 encoder->encodeFile(name.c_str(), pixels, SkScalarFloorToInt(quality));
68 return false; 66 return false;
69 } 67 }
OLDNEW
« no previous file with comments | « samplecode/SampleTextAlpha.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698