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

Side by Side Diff: bench/benchmain.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Moved code around to make code review easier Created 7 years, 4 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
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 8
9 9
10 #include "BenchTimer.h" 10 #include "BenchTimer.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 static SkDevice* make_device(SkBitmap::Config config, const SkIPoint& size, 196 static SkDevice* make_device(SkBitmap::Config config, const SkIPoint& size,
197 Backend backend, int sampleCount, GrContext* contex t) { 197 Backend backend, int sampleCount, GrContext* contex t) {
198 SkDevice* device = NULL; 198 SkDevice* device = NULL;
199 SkBitmap bitmap; 199 SkBitmap bitmap;
200 bitmap.setConfig(config, size.fX, size.fY); 200 bitmap.setConfig(config, size.fX, size.fY);
201 201
202 switch (backend) { 202 switch (backend) {
203 case kRaster_Backend: 203 case kRaster_Backend:
204 bitmap.allocPixels(); 204 bitmap.allocPixels();
205 erase(bitmap); 205 erase(bitmap);
206 device = SkNEW_ARGS(SkDevice, (bitmap)); 206 device = SkNEW_ARGS(SkRasterDevice, (bitmap));
207 break; 207 break;
208 #if SK_SUPPORT_GPU 208 #if SK_SUPPORT_GPU
209 case kGPU_Backend: { 209 case kGPU_Backend: {
210 GrTextureDesc desc; 210 GrTextureDesc desc;
211 desc.fConfig = kSkia8888_GrPixelConfig; 211 desc.fConfig = kSkia8888_GrPixelConfig;
212 desc.fFlags = kRenderTarget_GrTextureFlagBit; 212 desc.fFlags = kRenderTarget_GrTextureFlagBit;
213 desc.fWidth = size.fX; 213 desc.fWidth = size.fX;
214 desc.fHeight = size.fY; 214 desc.fHeight = size.fY;
215 desc.fSampleCnt = sampleCount; 215 desc.fSampleCnt = sampleCount;
216 SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc, NULL, 0)); 216 SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc, NULL, 0));
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 } 966 }
967 967
968 return 0; 968 return 0;
969 } 969 }
970 970
971 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 971 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
972 int main(int argc, char * const argv[]) { 972 int main(int argc, char * const argv[]) {
973 return tool_main(argc, (char**) argv); 973 return tool_main(argc, (char**) argv);
974 } 974 }
975 #endif 975 #endif
OLDNEW
« no previous file with comments | « bench/MergeBench.cpp ('k') | debugger/QT/SkRasterWidget.cpp » ('j') | include/core/SkDevice.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698