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

Side by Side Diff: tests/ReadPixelsTest.cpp

Issue 168653002: Change device factories to take SkImageInfo instead of SkBitmap::Config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix PdfViewer 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 | « tests/PremulAlphaRoundTripTest.cpp ('k') | no next file » | 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 * 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
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
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 }
OLDNEW
« no previous file with comments | « tests/PremulAlphaRoundTripTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698