Enable initializing an empty image
This commit is contained in:
parent
d65919d896
commit
513052de87
2 changed files with 8 additions and 6 deletions
|
@ -101,6 +101,9 @@ bool PopulateImageSkiaRepsFromPath(gfx::ImageSkia* image,
|
|||
bool Converter<gfx::ImageSkia>::FromV8(v8::Isolate* isolate,
|
||||
v8::Handle<v8::Value> val,
|
||||
gfx::ImageSkia* out) {
|
||||
if (val->IsNull())
|
||||
return true;
|
||||
|
||||
base::FilePath path;
|
||||
if (!Converter<base::FilePath>::FromV8(isolate, val, &path))
|
||||
return false;
|
||||
|
|
|
@ -28,20 +28,19 @@ bool Converter<gfx::ImageSkia>::FromV8(v8::Isolate* isolate,
|
|||
v8::Handle<v8::Value> val,
|
||||
gfx::ImageSkia* out) {
|
||||
gfx::Image image;
|
||||
if (!ConvertFromV8(isolate, val, &image) || image.IsEmpty())
|
||||
if (!ConvertFromV8(isolate, val, &image))
|
||||
return false;
|
||||
|
||||
gfx::ImageSkia image_skia = image.AsImageSkia();
|
||||
if (image_skia.isNull())
|
||||
return false;
|
||||
|
||||
*out = image_skia;
|
||||
*out = image.AsImageSkia();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Converter<gfx::Image>::FromV8(v8::Isolate* isolate,
|
||||
v8::Handle<v8::Value> val,
|
||||
gfx::Image* out) {
|
||||
if (val->IsNull())
|
||||
return true;
|
||||
|
||||
std::string path;
|
||||
if (!ConvertFromV8(isolate, val, &path))
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue