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

Side by Side Diff: src/core/SkBitmapDevice.cpp

Issue 308683005: setConfig -> setInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: missed one setConfig (release only) 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 | « src/core/SkBitmap.cpp ('k') | src/core/SkBitmapScaler.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 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkConfig8888.h" 9 #include "SkConfig8888.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo, 71 SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo,
72 const SkDeviceProperties* props) { 72 const SkDeviceProperties* props) {
73 SkImageInfo info = origInfo; 73 SkImageInfo info = origInfo;
74 if (!valid_for_bitmap_device(info, &info.fAlphaType)) { 74 if (!valid_for_bitmap_device(info, &info.fAlphaType)) {
75 return NULL; 75 return NULL;
76 } 76 }
77 77
78 SkBitmap bitmap; 78 SkBitmap bitmap;
79 79
80 if (kUnknown_SkColorType == info.colorType()) { 80 if (kUnknown_SkColorType == info.colorType()) {
81 if (!bitmap.setConfig(info)) { 81 if (!bitmap.setInfo(info)) {
82 return NULL; 82 return NULL;
83 } 83 }
84 } else { 84 } else {
85 if (!bitmap.allocPixels(info)) { 85 if (!bitmap.allocPixels(info)) {
86 return NULL; 86 return NULL;
87 } 87 }
88 if (!bitmap.info().isOpaque()) { 88 if (!bitmap.info().isOpaque()) {
89 bitmap.eraseColor(SK_ColorTRANSPARENT); 89 bitmap.eraseColor(SK_ColorTRANSPARENT);
90 } 90 }
91 } 91 }
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 paint.getStyle() != SkPaint::kFill_Style || 468 paint.getStyle() != SkPaint::kFill_Style ||
469 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { 469 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) {
470 // turn off lcd 470 // turn off lcd
471 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; 471 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag;
472 flags->fHinting = paint.getHinting(); 472 flags->fHinting = paint.getHinting();
473 return true; 473 return true;
474 } 474 }
475 // we're cool with the paint as is 475 // we're cool with the paint as is
476 return false; 476 return false;
477 } 477 }
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkBitmapScaler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698