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

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

Issue 1539553002: Add default ctor to SkMask (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add warning for ignored return values Created 5 years 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
« no previous file with comments | « src/core/SkAAClip.cpp ('k') | src/core/SkDraw.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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 1026
1027 srcM.fBounds.set(0, 0, this->width(), this->height()); 1027 srcM.fBounds.set(0, 0, this->width(), this->height());
1028 srcM.fRowBytes = SkAlign4(this->width()); 1028 srcM.fRowBytes = SkAlign4(this->width());
1029 srcM.fFormat = SkMask::kA8_Format; 1029 srcM.fFormat = SkMask::kA8_Format;
1030 1030
1031 SkMaskFilter* filter = paint ? paint->getMaskFilter() : nullptr; 1031 SkMaskFilter* filter = paint ? paint->getMaskFilter() : nullptr;
1032 1032
1033 // compute our (larger?) dst bounds if we have a filter 1033 // compute our (larger?) dst bounds if we have a filter
1034 if (filter) { 1034 if (filter) {
1035 identity.reset(); 1035 identity.reset();
1036 srcM.fImage = nullptr;
1037 if (!filter->filterMask(&dstM, srcM, identity, nullptr)) { 1036 if (!filter->filterMask(&dstM, srcM, identity, nullptr)) {
1038 goto NO_FILTER_CASE; 1037 goto NO_FILTER_CASE;
1039 } 1038 }
1040 dstM.fRowBytes = SkAlign4(dstM.fBounds.width()); 1039 dstM.fRowBytes = SkAlign4(dstM.fBounds.width());
1041 } else { 1040 } else {
1042 NO_FILTER_CASE: 1041 NO_FILTER_CASE:
1043 tmpBitmap.setInfo(SkImageInfo::MakeA8(this->width(), this->height()), sr cM.fRowBytes); 1042 tmpBitmap.setInfo(SkImageInfo::MakeA8(this->width(), this->height()), sr cM.fRowBytes);
1044 if (!tmpBitmap.tryAllocPixels(allocator, nullptr)) { 1043 if (!tmpBitmap.tryAllocPixels(allocator, nullptr)) {
1045 // Allocation of pixels for alpha bitmap failed. 1044 // Allocation of pixels for alpha bitmap failed.
1046 SkDebugf("extractAlpha failed to allocate (%d,%d) alpha bitmap\n", 1045 SkDebugf("extractAlpha failed to allocate (%d,%d) alpha bitmap\n",
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 /////////////////////////////////////////////////////////////////////////////// 1337 ///////////////////////////////////////////////////////////////////////////////
1339 1338
1340 #ifdef SK_DEBUG 1339 #ifdef SK_DEBUG
1341 void SkImageInfo::validate() const { 1340 void SkImageInfo::validate() const {
1342 SkASSERT(fWidth >= 0); 1341 SkASSERT(fWidth >= 0);
1343 SkASSERT(fHeight >= 0); 1342 SkASSERT(fHeight >= 0);
1344 SkASSERT(SkColorTypeIsValid(fColorType)); 1343 SkASSERT(SkColorTypeIsValid(fColorType));
1345 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); 1344 SkASSERT(SkAlphaTypeIsValid(fAlphaType));
1346 } 1345 }
1347 #endif 1346 #endif
OLDNEW
« no previous file with comments | « src/core/SkAAClip.cpp ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698