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

Side by Side Diff: samplecode/SampleFontCache.cpp

Issue 169063002: use SkColorType instead of SkBitmap::Config in samplecode (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | « samplecode/SampleFilterFuzz.cpp ('k') | samplecode/SampleHairModes.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 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 SkBitmap fBitmaps[N]; 85 SkBitmap fBitmaps[N];
86 86
87 FontCacheView() { 87 FontCacheView() {
88 gDone = false; 88 gDone = false;
89 for (int i = 0; i < N; i++) { 89 for (int i = 0; i < N; i++) {
90 int status; 90 int status;
91 91
92 status = pthread_create(&fMThreads[i], NULL, measure_proc, NULL); 92 status = pthread_create(&fMThreads[i], NULL, measure_proc, NULL);
93 SkASSERT(0 == status); 93 SkASSERT(0 == status);
94 94
95 fBitmaps[i].setConfig(SkBitmap::kRGB_565_Config, 320, 240); 95 fBitmaps[i].allocPixels(SkImageInfo::Make(320, 240,
96 fBitmaps[i].allocPixels(); 96 kRGB_565_SkColorType,
97 kOpaque_SkAlphaType));
97 status = pthread_create(&fDThreads[i], NULL, draw_proc, &fBitmaps[i ]); 98 status = pthread_create(&fDThreads[i], NULL, draw_proc, &fBitmaps[i ]);
98 SkASSERT(0 == status); 99 SkASSERT(0 == status);
99 } 100 }
100 this->setBGColor(0xFFDDDDDD); 101 this->setBGColor(0xFFDDDDDD);
101 } 102 }
102 103
103 virtual ~FontCacheView() { 104 virtual ~FontCacheView() {
104 gDone = true; 105 gDone = true;
105 for (int i = 0; i < N; i++) { 106 for (int i = 0; i < N; i++) {
106 void* ret; 107 void* ret;
(...skipping 25 matching lines...) Expand all
132 } 133 }
133 134
134 private: 135 private:
135 typedef SampleView INHERITED; 136 typedef SampleView INHERITED;
136 }; 137 };
137 138
138 ////////////////////////////////////////////////////////////////////////////// 139 //////////////////////////////////////////////////////////////////////////////
139 140
140 static SkView* MyFactory() { return new FontCacheView; } 141 static SkView* MyFactory() { return new FontCacheView; }
141 static SkViewRegister reg(MyFactory); 142 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | samplecode/SampleHairModes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698