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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Image.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 /* 1 /*
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include <tuple> 49 #include <tuple>
50 50
51 namespace blink { 51 namespace blink {
52 52
53 Image::Image(ImageObserver* observer) 53 Image::Image(ImageObserver* observer)
54 : m_imageObserver(observer), m_imageObserverDisabled(false) {} 54 : m_imageObserver(observer), m_imageObserverDisabled(false) {}
55 55
56 Image::~Image() {} 56 Image::~Image() {}
57 57
58 Image* Image::nullImage() { 58 Image* Image::nullImage() {
59 ASSERT(isMainThread()); 59 DCHECK(isMainThread());
60 DEFINE_STATIC_REF(Image, nullImage, (BitmapImage::create())); 60 DEFINE_STATIC_REF(Image, nullImage, (BitmapImage::create()));
61 return nullImage; 61 return nullImage;
62 } 62 }
63 63
64 PassRefPtr<Image> Image::loadPlatformResource(const char* name) { 64 PassRefPtr<Image> Image::loadPlatformResource(const char* name) {
65 const WebData& resource = Platform::current()->loadResource(name); 65 const WebData& resource = Platform::current()->loadResource(name);
66 if (resource.isEmpty()) 66 if (resource.isEmpty())
67 return Image::nullImage(); 67 return Image::nullImage();
68 68
69 RefPtr<Image> image = BitmapImage::create(); 69 RefPtr<Image> image = BitmapImage::create();
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 FloatRect subset = dest; 378 FloatRect subset = dest;
379 subset.setX((dest.x() - tile.x()) / scale.width()); 379 subset.setX((dest.x() - tile.x()) / scale.width());
380 subset.setY((dest.y() - tile.y()) / scale.height()); 380 subset.setY((dest.y() - tile.y()) / scale.height());
381 subset.setWidth(dest.width() / scale.width()); 381 subset.setWidth(dest.width() / scale.width());
382 subset.setHeight(dest.height() / scale.height()); 382 subset.setHeight(dest.height() / scale.height());
383 383
384 return subset; 384 return subset;
385 } 385 }
386 386
387 } // namespace blink 387 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698