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

Unified Diff: src/gpu/SkGrPixelRef.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/gpu/batches/GrAAFillRectBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGrPixelRef.cpp
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index 50b1269b378fa269b6f19712d1afb069b205a9db..6e014feded1faba16afb4b0607349857a6172ce0 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -25,17 +25,17 @@ SkROLockPixelsPixelRef::~SkROLockPixelsPixelRef() {}
bool SkROLockPixelsPixelRef::onNewLockPixels(LockRec* rec) {
fBitmap.reset();
// SkDebugf("---------- calling readpixels in support of lockpixels\n");
- if (!this->onReadPixels(&fBitmap, NULL)) {
+ if (!this->onReadPixels(&fBitmap, nullptr)) {
SkDebugf("SkROLockPixelsPixelRef::onLockPixels failed!\n");
return false;
}
fBitmap.lockPixels();
- if (NULL == fBitmap.getPixels()) {
+ if (nullptr == fBitmap.getPixels()) {
return false;
}
rec->fPixels = fBitmap.getPixels();
- rec->fColorTable = NULL;
+ rec->fColorTable = nullptr;
rec->fRowBytes = fBitmap.rowBytes();
return true;
}
@@ -52,12 +52,12 @@ bool SkROLockPixelsPixelRef::onLockPixelsAreWritable() const {
static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorType dstCT,
SkColorProfileType dstPT, const SkIRect* subset) {
- if (NULL == texture || kUnknown_SkColorType == dstCT) {
- return NULL;
+ if (nullptr == texture || kUnknown_SkColorType == dstCT) {
+ return nullptr;
}
GrContext* context = texture->getContext();
- if (NULL == context) {
- return NULL;
+ if (nullptr == context) {
+ return nullptr;
}
GrSurfaceDesc desc;
@@ -77,9 +77,9 @@ static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorTyp
desc.fFlags = kRenderTarget_GrSurfaceFlag;
desc.fConfig = SkImageInfo2GrPixelConfig(dstCT, kPremul_SkAlphaType, dstPT);
- GrTexture* dst = context->textureProvider()->createTexture(desc, false, NULL, 0);
- if (NULL == dst) {
- return NULL;
+ GrTexture* dst = context->textureProvider()->createTexture(desc, false, nullptr, 0);
+ if (nullptr == dst) {
+ return nullptr;
}
// Blink is relying on the above copy being sent to GL immediately in the case when the source
@@ -102,7 +102,7 @@ SkGrPixelRef::SkGrPixelRef(const SkImageInfo& info, GrSurface* surface) : INHERI
// render target but not vice versa. So we ref the texture to keep both alive for
// the lifetime of this pixel ref.
fSurface = SkSafeRef(surface->asTexture());
- if (NULL == fSurface) {
+ if (nullptr == fSurface) {
fSurface = SkSafeRef(surface);
}
@@ -120,7 +120,7 @@ GrTexture* SkGrPixelRef::getTexture() {
if (fSurface) {
return fSurface->asTexture();
}
- return NULL;
+ return nullptr;
}
void SkGrPixelRef::onNotifyPixelsChanged() {
@@ -132,8 +132,8 @@ void SkGrPixelRef::onNotifyPixelsChanged() {
SkPixelRef* SkGrPixelRef::deepCopy(SkColorType dstCT, SkColorProfileType dstPT,
const SkIRect* subset) {
- if (NULL == fSurface) {
- return NULL;
+ if (nullptr == fSurface) {
+ return nullptr;
}
// Note that when copying a render-target-backed pixel ref, we
@@ -147,7 +147,7 @@ SkPixelRef* SkGrPixelRef::deepCopy(SkColorType dstCT, SkColorProfileType dstPT,
static bool tryAllocBitmapPixels(SkBitmap* bitmap) {
SkBitmap::Allocator* allocator = SkBitmapCache::GetAllocator();
- if (NULL != allocator) {
+ if (nullptr != allocator) {
return allocator->allocPixelRef(bitmap, 0);
} else {
// DiscardableMemory is not available, fallback to default allocator
@@ -156,7 +156,7 @@ static bool tryAllocBitmapPixels(SkBitmap* bitmap) {
}
bool SkGrPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) {
- if (NULL == fSurface || fSurface->wasDestroyed()) {
+ if (nullptr == fSurface || fSurface->wasDestroyed()) {
return false;
}
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/gpu/batches/GrAAFillRectBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698