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

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

Issue 2559013002: Add ColorBehavior to blink::Image draw methods (Closed)
Patch Set: Rebase Created 4 years 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 } else if (isHTMLCanvasElement(node)) { 881 } else if (isHTMLCanvasElement(node)) {
882 imageBitmap = ImageBitmap::create(toHTMLCanvasElement(node), 882 imageBitmap = ImageBitmap::create(toHTMLCanvasElement(node),
883 Optional<IntRect>(), options); 883 Optional<IntRect>(), options);
884 } else if (isHTMLVideoElement(node)) { 884 } else if (isHTMLVideoElement(node)) {
885 imageBitmap = ImageBitmap::create(toHTMLVideoElement(node), 885 imageBitmap = ImageBitmap::create(toHTMLVideoElement(node),
886 Optional<IntRect>(), document, options); 886 Optional<IntRect>(), document, options);
887 } 887 }
888 if (!imageBitmap) 888 if (!imageBitmap)
889 return String(); 889 return String();
890 890
891 sk_sp<SkImage> image = imageBitmap->bitmapImage()->imageForCurrentFrame(); 891 // TODO(ccameron): AXLayoutObject::imageDataUrl should create sRGB images.
892 sk_sp<SkImage> image = imageBitmap->bitmapImage()->imageForCurrentFrame(
893 ColorBehavior::transformToGlobalTarget());
892 if (!image || image->width() <= 0 || image->height() <= 0) 894 if (!image || image->width() <= 0 || image->height() <= 0)
893 return String(); 895 return String();
894 896
895 // Determine the width and height of the output image, using a proportional 897 // Determine the width and height of the output image, using a proportional
896 // scale factor such that it's no larger than |maxSize|, if |maxSize| is not 898 // scale factor such that it's no larger than |maxSize|, if |maxSize| is not
897 // empty. It only resizes the image to be smaller (if necessary), not 899 // empty. It only resizes the image to be smaller (if necessary), not
898 // larger. 900 // larger.
899 float xScale = maxSize.width() ? maxSize.width() * 1.0 / image->width() : 1.0; 901 float xScale = maxSize.width() ? maxSize.width() * 1.0 / image->width() : 1.0;
900 float yScale = 902 float yScale =
901 maxSize.height() ? maxSize.height() * 1.0 / image->height() : 1.0; 903 maxSize.height() ? maxSize.height() * 1.0 / image->height() : 1.0;
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
2479 2481
2480 bool AXLayoutObject::elementAttributeValue( 2482 bool AXLayoutObject::elementAttributeValue(
2481 const QualifiedName& attributeName) const { 2483 const QualifiedName& attributeName) const {
2482 if (!m_layoutObject) 2484 if (!m_layoutObject)
2483 return false; 2485 return false;
2484 2486
2485 return equalIgnoringCase(getAttribute(attributeName), "true"); 2487 return equalIgnoringCase(getAttribute(attributeName), "true");
2486 } 2488 }
2487 2489
2488 } // namespace blink 2490 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698