| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 for (int dtype = 0; dtype < 3; ++dtype) { | 303 for (int dtype = 0; dtype < 3; ++dtype) { |
| 304 int glCtxTypeCnt = 1; | 304 int glCtxTypeCnt = 1; |
| 305 #if SK_SUPPORT_GPU | 305 #if SK_SUPPORT_GPU |
| 306 if (0 != dtype) { | 306 if (0 != dtype) { |
| 307 glCtxTypeCnt = GrContextFactory::kGLContextTypeCnt; | 307 glCtxTypeCnt = GrContextFactory::kGLContextTypeCnt; |
| 308 } | 308 } |
| 309 #endif | 309 #endif |
| 310 for (int glCtxType = 0; glCtxType < glCtxTypeCnt; ++glCtxType) { | 310 for (int glCtxType = 0; glCtxType < glCtxTypeCnt; ++glCtxType) { |
| 311 SkAutoTUnref<SkBaseDevice> device; | 311 SkAutoTUnref<SkBaseDevice> device; |
| 312 if (0 == dtype) { | 312 if (0 == dtype) { |
| 313 device.reset(new SkBitmapDevice(SkBitmap::kARGB_8888_Config, | 313 SkImageInfo info = SkImageInfo::MakeN32Premul(DEV_W, DEV_H); |
| 314 DEV_W, DEV_H, false)); | 314 device.reset(SkBitmapDevice::Create(info)); |
| 315 } else { | 315 } else { |
| 316 #if SK_SUPPORT_GPU | 316 #if SK_SUPPORT_GPU |
| 317 GrContextFactory::GLContextType type = | 317 GrContextFactory::GLContextType type = |
| 318 static_cast<GrContextFactory::GLContextType>(glCtxType); | 318 static_cast<GrContextFactory::GLContextType>(glCtxType); |
| 319 if (!GrContextFactory::IsRenderingGLContext(type)) { | 319 if (!GrContextFactory::IsRenderingGLContext(type)) { |
| 320 continue; | 320 continue; |
| 321 } | 321 } |
| 322 GrContext* context = factory->get(type); | 322 GrContext* context = factory->get(type); |
| 323 if (NULL == context) { | 323 if (NULL == context) { |
| 324 continue; | 324 continue; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 clippedRect.fTop, true, false, | 400 clippedRect.fTop, true, false, |
| 401 SkCanvas::kNative_Premul_Config8888); | 401 SkCanvas::kNative_Premul_Config8888); |
| 402 } else { | 402 } else { |
| 403 REPORTER_ASSERT(reporter, !success); | 403 REPORTER_ASSERT(reporter, !success); |
| 404 } | 404 } |
| 405 } | 405 } |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 } | 408 } |
| 409 } | 409 } |
| OLD | NEW |