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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 2727133002: Remove ColorBehavior argument to Image::imageForCurrentFrame (Closed)
Patch Set: Rebase Created 3 years, 9 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 imageBitmap = ImageBitmap::create(toHTMLVideoElement(node), 893 imageBitmap = ImageBitmap::create(toHTMLVideoElement(node),
894 Optional<IntRect>(), document, options); 894 Optional<IntRect>(), document, options);
895 } 895 }
896 if (!imageBitmap) 896 if (!imageBitmap)
897 return String(); 897 return String();
898 898
899 StaticBitmapImage* bitmapImage = imageBitmap->bitmapImage(); 899 StaticBitmapImage* bitmapImage = imageBitmap->bitmapImage();
900 if (!bitmapImage) 900 if (!bitmapImage)
901 return String(); 901 return String();
902 902
903 // TODO(ccameron): AXLayoutObject::imageDataUrl should create sRGB images. 903 sk_sp<SkImage> image = bitmapImage->imageForCurrentFrame();
904 sk_sp<SkImage> image = bitmapImage->imageForCurrentFrame(
905 ColorBehavior::transformToGlobalTarget());
906 if (!image || image->width() <= 0 || image->height() <= 0) 904 if (!image || image->width() <= 0 || image->height() <= 0)
907 return String(); 905 return String();
908 906
909 // Determine the width and height of the output image, using a proportional 907 // Determine the width and height of the output image, using a proportional
910 // scale factor such that it's no larger than |maxSize|, if |maxSize| is not 908 // scale factor such that it's no larger than |maxSize|, if |maxSize| is not
911 // empty. It only resizes the image to be smaller (if necessary), not 909 // empty. It only resizes the image to be smaller (if necessary), not
912 // larger. 910 // larger.
913 float xScale = maxSize.width() ? maxSize.width() * 1.0 / image->width() : 1.0; 911 float xScale = maxSize.width() ? maxSize.width() * 1.0 / image->width() : 1.0;
914 float yScale = 912 float yScale =
915 maxSize.height() ? maxSize.height() * 1.0 / image->height() : 1.0; 913 maxSize.height() ? maxSize.height() * 1.0 / image->height() : 1.0;
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
2493 2491
2494 bool AXLayoutObject::elementAttributeValue( 2492 bool AXLayoutObject::elementAttributeValue(
2495 const QualifiedName& attributeName) const { 2493 const QualifiedName& attributeName) const {
2496 if (!m_layoutObject) 2494 if (!m_layoutObject)
2497 return false; 2495 return false;
2498 2496
2499 return equalIgnoringCase(getAttribute(attributeName), "true"); 2497 return equalIgnoringCase(getAttribute(attributeName), "true");
2500 } 2498 }
2501 2499
2502 } // namespace blink 2500 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698