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

Side by Side Diff: tests/WritePixelsTest.cpp

Issue 302053002: Revert of setConfig -> setInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 6 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/ShaderOpacityTest.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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 #endif 283 #endif
284 }; 284 };
285 285
286 #include "SkMallocPixelRef.h" 286 #include "SkMallocPixelRef.h"
287 287
288 // This is a tricky pattern, because we have to setConfig+rowBytes AND specify 288 // This is a tricky pattern, because we have to setConfig+rowBytes AND specify
289 // a custom pixelRef (which also has to specify its rowBytes), so we have to be 289 // a custom pixelRef (which also has to specify its rowBytes), so we have to be
290 // sure that the two rowBytes match (and the infos match). 290 // sure that the two rowBytes match (and the infos match).
291 // 291 //
292 static bool allocRowBytes(SkBitmap* bm, const SkImageInfo& info, size_t rowBytes ) { 292 static bool allocRowBytes(SkBitmap* bm, const SkImageInfo& info, size_t rowBytes ) {
293 if (!bm->setInfo(info, rowBytes)) { 293 if (!bm->setConfig(info, rowBytes)) {
294 return false; 294 return false;
295 } 295 }
296 SkPixelRef* pr = SkMallocPixelRef::NewAllocate(info, rowBytes, NULL); 296 SkPixelRef* pr = SkMallocPixelRef::NewAllocate(info, rowBytes, NULL);
297 bm->setPixelRef(pr)->unref(); 297 bm->setPixelRef(pr)->unref();
298 return true; 298 return true;
299 } 299 }
300 300
301 static SkBaseDevice* createDevice(const CanvasConfig& c, GrContext* grCtx) { 301 static SkBaseDevice* createDevice(const CanvasConfig& c, GrContext* grCtx) {
302 switch (c.fDevType) { 302 switch (c.fDevType) {
303 case kRaster_DevType: { 303 case kRaster_DevType: {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 SkIRect writeRect = SkIRect::MakeXYWH(rect.fLeft, rect.f Top, 462 SkIRect writeRect = SkIRect::MakeXYWH(rect.fLeft, rect.f Top,
463 bmp.width(), bmp.h eight()); 463 bmp.width(), bmp.h eight());
464 bool intersects = SkIRect::Intersects(canvasRect, writeR ect) ; 464 bool intersects = SkIRect::Intersects(canvasRect, writeR ect) ;
465 REPORTER_ASSERT(reporter, intersects == (idBefore != idA fter)); 465 REPORTER_ASSERT(reporter, intersects == (idBefore != idA fter));
466 } 466 }
467 } 467 }
468 } 468 }
469 } 469 }
470 } 470 }
471 } 471 }
OLDNEW
« no previous file with comments | « tests/ShaderOpacityTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698