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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/skia/ImagePixelLocker.cpp

Issue 2807923002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics (Closed)
Patch Set: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/graphics Created 3 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/graphics/skia/ImagePixelLocker.h" 5 #include "platform/graphics/skia/ImagePixelLocker.h"
6 6
7 #include "third_party/skia/include/core/SkImage.h" 7 #include "third_party/skia/include/core/SkImage.h"
8 #include "third_party/skia/include/core/SkImageInfo.h" 8 #include "third_party/skia/include/core/SkImageInfo.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 namespace { 12 namespace {
13 13
14 bool infoIsCompatible(const SkImageInfo& info, 14 bool infoIsCompatible(const SkImageInfo& info,
15 SkAlphaType alphaType, 15 SkAlphaType alphaType,
16 SkColorType colorType) { 16 SkColorType colorType) {
17 ASSERT(alphaType != kUnknown_SkAlphaType); 17 DCHECK_NE(alphaType, kUnknown_SkAlphaType);
18 18
19 if (info.colorType() != colorType) 19 if (info.colorType() != colorType)
20 return false; 20 return false;
21 21
22 // kOpaque_SkAlphaType works regardless of the requested alphaType. 22 // kOpaque_SkAlphaType works regardless of the requested alphaType.
23 return info.alphaType() == alphaType || 23 return info.alphaType() == alphaType ||
24 info.alphaType() == kOpaque_SkAlphaType; 24 info.alphaType() == kOpaque_SkAlphaType;
25 } 25 }
26 26
27 } // anonymous namespace 27 } // anonymous namespace
(...skipping 26 matching lines...) Expand all
54 m_pixelStorage.resize(size); // this will throw on failure 54 m_pixelStorage.resize(size); // this will throw on failure
55 pixmap.reset(info, m_pixelStorage.data(), rowBytes); 55 pixmap.reset(info, m_pixelStorage.data(), rowBytes);
56 56
57 if (!m_image->readPixels(pixmap, 0, 0)) 57 if (!m_image->readPixels(pixmap, 0, 0))
58 return; 58 return;
59 59
60 m_pixels = m_pixelStorage.data(); 60 m_pixels = m_pixelStorage.data();
61 } 61 }
62 62
63 } // namespace blink 63 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698