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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/graphics/gpu/WebGLImageConversion.h" 5 #include "platform/graphics/gpu/WebGLImageConversion.h"
6 6
7 #include "platform/graphics/ImageObserver.h" 7 #include "platform/graphics/ImageObserver.h"
8 #include "platform/graphics/cpu/arm/WebGLImageConversionNEON.h" 8 #include "platform/graphics/cpu/arm/WebGLImageConversionNEON.h"
9 #include "platform/graphics/cpu/mips/WebGLImageConversionMSA.h" 9 #include "platform/graphics/cpu/mips/WebGLImageConversionMSA.h"
10 #include "platform/graphics/cpu/x86/WebGLImageConversionSSE.h" 10 #include "platform/graphics/cpu/x86/WebGLImageConversionSSE.h"
(...skipping 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 extractImage(premultiplyAlpha, ignoreColorSpace); 2732 extractImage(premultiplyAlpha, ignoreColorSpace);
2733 } 2733 }
2734 2734
2735 void WebGLImageConversion::ImageExtractor::extractImage(bool premultiplyAlpha, 2735 void WebGLImageConversion::ImageExtractor::extractImage(bool premultiplyAlpha,
2736 bool ignoreColorSpace) { 2736 bool ignoreColorSpace) {
2737 ASSERT(!m_imagePixelLocker); 2737 ASSERT(!m_imagePixelLocker);
2738 2738
2739 if (!m_image) 2739 if (!m_image)
2740 return; 2740 return;
2741 2741
2742 // TODO(ccameron): WebGL should operate in sRGB. 2742 sk_sp<SkImage> skiaImage = m_image->imageForCurrentFrame();
2743 // https://crbug.com/672299
2744 sk_sp<SkImage> skiaImage =
2745 m_image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget());
2746 SkImageInfo info = skiaImage ? SkImageInfo::MakeN32Premul(m_image->width(), 2743 SkImageInfo info = skiaImage ? SkImageInfo::MakeN32Premul(m_image->width(),
2747 m_image->height()) 2744 m_image->height())
2748 : SkImageInfo::MakeUnknown(); 2745 : SkImageInfo::MakeUnknown();
2749 m_alphaOp = AlphaDoNothing; 2746 m_alphaOp = AlphaDoNothing;
2750 bool hasAlpha = skiaImage ? !skiaImage->isOpaque() : true; 2747 bool hasAlpha = skiaImage ? !skiaImage->isOpaque() : true;
2751 2748
2752 if ((!skiaImage || ignoreColorSpace || (hasAlpha && !premultiplyAlpha)) && 2749 if ((!skiaImage || ignoreColorSpace || (hasAlpha && !premultiplyAlpha)) &&
2753 m_image->data()) { 2750 m_image->data()) {
2754 // Attempt to get raw unpremultiplied image data. 2751 // Attempt to get raw unpremultiplied image data.
2755 std::unique_ptr<ImageDecoder> decoder(ImageDecoder::create( 2752 std::unique_ptr<ImageDecoder> decoder(ImageDecoder::create(
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
3171 pack<WebGLImageConversion::DataFormatRGB565, 3168 pack<WebGLImageConversion::DataFormatRGB565,
3172 WebGLImageConversion::AlphaDoNothing>(srcRowStart, dstRowStart, 3169 WebGLImageConversion::AlphaDoNothing>(srcRowStart, dstRowStart,
3173 pixelsPerRow); 3170 pixelsPerRow);
3174 } break; 3171 } break;
3175 default: 3172 default:
3176 break; 3173 break;
3177 } 3174 }
3178 } 3175 }
3179 3176
3180 } // namespace blink 3177 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698