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

Side by Side Diff: sky/engine/platform/graphics/Image.cpp

Issue 752463002: Remove unused WebMIMERegistry (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/platform/graphics/Image.h ('k') | sky/engine/public/BUILD.gn » ('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 (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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { 66 {
67 const WebData& resource = Platform::current()->loadResource(name); 67 const WebData& resource = Platform::current()->loadResource(name);
68 if (resource.isEmpty()) 68 if (resource.isEmpty())
69 return Image::nullImage(); 69 return Image::nullImage();
70 70
71 RefPtr<Image> image = BitmapImage::create(); 71 RefPtr<Image> image = BitmapImage::create();
72 image->setData(resource, true); 72 image->setData(resource, true);
73 return image.release(); 73 return image.release();
74 } 74 }
75 75
76 bool Image::supportsType(const String& type)
77 {
78 return MIMETypeRegistry::isSupportedImageResourceMIMEType(type);
79 }
80
81 bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived) 76 bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
82 { 77 {
83 m_encodedImageData = data; 78 m_encodedImageData = data;
84 if (!m_encodedImageData.get()) 79 if (!m_encodedImageData.get())
85 return true; 80 return true;
86 81
87 int length = m_encodedImageData->size(); 82 int length = m_encodedImageData->size();
88 if (!length) 83 if (!length)
89 return true; 84 return true;
90 85
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 233 }
239 234
240 PassRefPtr<Image> Image::imageForDefaultFrame() 235 PassRefPtr<Image> Image::imageForDefaultFrame()
241 { 236 {
242 RefPtr<Image> image(this); 237 RefPtr<Image> image(this);
243 238
244 return image.release(); 239 return image.release();
245 } 240 }
246 241
247 } // namespace blink 242 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/graphics/Image.h ('k') | sky/engine/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698