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

Side by Side Diff: samplecode/SampleFatBits.cpp

Issue 54363008: move SkImage::ColorType into SkColorType (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 void setWHZ(int width, int height, int zoom) { 100 void setWHZ(int width, int height, int zoom) {
101 fW = width; 101 fW = width;
102 fH = height; 102 fH = height;
103 fZoom = zoom; 103 fZoom = zoom;
104 fBounds.set(0, 0, SkIntToScalar(width * zoom), SkIntToScalar(height * zo om)); 104 fBounds.set(0, 0, SkIntToScalar(width * zoom), SkIntToScalar(height * zo om));
105 fMatrix.setScale(SkIntToScalar(zoom), SkIntToScalar(zoom)); 105 fMatrix.setScale(SkIntToScalar(zoom), SkIntToScalar(zoom));
106 fInverse.setScale(SK_Scalar1 / zoom, SK_Scalar1 / zoom); 106 fInverse.setScale(SK_Scalar1 / zoom, SK_Scalar1 / zoom);
107 fShader->setLocalMatrix(fMatrix); 107 fShader->setLocalMatrix(fMatrix);
108 108
109 SkImage::Info info = { 109 SkImageInfo info = {
110 width, height, SkImage::kPMColor_ColorType, SkImage::kPremul_AlphaTy pe 110 width, height, kPMColor_SkColorType, kPremul_SkAlphaType
111 }; 111 };
112 fMinSurface.reset(SkSurface::NewRaster(info)); 112 fMinSurface.reset(SkSurface::NewRaster(info));
113 info.fWidth *= zoom; 113 info.fWidth *= zoom;
114 info.fHeight *= zoom; 114 info.fHeight *= zoom;
115 fMaxSurface.reset(SkSurface::NewRaster(info)); 115 fMaxSurface.reset(SkSurface::NewRaster(info));
116 } 116 }
117 117
118 void drawBG(SkCanvas*); 118 void drawBG(SkCanvas*);
119 void drawFG(SkCanvas*); 119 void drawFG(SkCanvas*);
120 void drawLine(SkCanvas*, SkPoint pts[2]); 120 void drawLine(SkCanvas*, SkPoint pts[2]);
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 private: 526 private:
527 527
528 typedef SampleView INHERITED; 528 typedef SampleView INHERITED;
529 }; 529 };
530 530
531 ////////////////////////////////////////////////////////////////////////////// 531 //////////////////////////////////////////////////////////////////////////////
532 532
533 static SkView* MyFactory() { return new DrawLineView; } 533 static SkView* MyFactory() { return new DrawLineView; }
534 static SkViewRegister reg(MyFactory); 534 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « platform_tools/android/examples/hello_skia_app/jni/helloskia.cpp ('k') | src/image/SkImagePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698