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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 if (rect == m_contentsRect) 1061 if (rect == m_contentsRect)
1062 return; 1062 return;
1063 1063
1064 m_contentsRect = rect; 1064 m_contentsRect = rect;
1065 updateContentsRect(); 1065 updateContentsRect();
1066 } 1066 }
1067 1067
1068 void GraphicsLayer::setContentsToImage( 1068 void GraphicsLayer::setContentsToImage(
1069 Image* image, 1069 Image* image,
1070 RespectImageOrientationEnum respectImageOrientation) { 1070 RespectImageOrientationEnum respectImageOrientation) {
1071 sk_sp<SkImage> skImage = image ? image->imageForCurrentFrame() : nullptr; 1071 sk_sp<SkImage> skImage =
1072 image ? image->imageForCurrentFrame(m_colorBehavior) : nullptr;
1072 1073
1073 if (image && skImage && image->isBitmapImage()) { 1074 if (image && skImage && image->isBitmapImage()) {
1074 if (respectImageOrientation == RespectImageOrientation) { 1075 if (respectImageOrientation == RespectImageOrientation) {
1075 ImageOrientation imageOrientation = 1076 ImageOrientation imageOrientation =
1076 toBitmapImage(image)->currentFrameOrientation(); 1077 toBitmapImage(image)->currentFrameOrientation();
1077 skImage = 1078 skImage =
1078 DragImage::resizeAndOrientImage(std::move(skImage), imageOrientation); 1079 DragImage::resizeAndOrientImage(std::move(skImage), imageOrientation);
1079 } 1080 }
1080 } 1081 }
1081 1082
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { 1329 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) {
1329 if (!layer) { 1330 if (!layer) {
1330 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; 1331 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil).";
1331 return; 1332 return;
1332 } 1333 }
1333 1334
1334 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1335 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1335 LOG(INFO) << output.utf8().data(); 1336 LOG(INFO) << output.utf8().data();
1336 } 1337 }
1337 #endif 1338 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698