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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 1309393007: [poc] redecode Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: resetColorProfileForTesting rename Created 5 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 21 matching lines...) Expand all
32 #include "cc/layers/layer.h" 32 #include "cc/layers/layer.h"
33 #include "platform/DragImage.h" 33 #include "platform/DragImage.h"
34 #include "platform/JSONValues.h" 34 #include "platform/JSONValues.h"
35 #include "platform/TraceEvent.h" 35 #include "platform/TraceEvent.h"
36 #include "platform/geometry/FloatRect.h" 36 #include "platform/geometry/FloatRect.h"
37 #include "platform/geometry/LayoutRect.h" 37 #include "platform/geometry/LayoutRect.h"
38 #include "platform/graphics/BitmapImage.h" 38 #include "platform/graphics/BitmapImage.h"
39 #include "platform/graphics/FirstPaintInvalidationTracking.h" 39 #include "platform/graphics/FirstPaintInvalidationTracking.h"
40 #include "platform/graphics/GraphicsContext.h" 40 #include "platform/graphics/GraphicsContext.h"
41 #include "platform/graphics/GraphicsLayerFactory.h" 41 #include "platform/graphics/GraphicsLayerFactory.h"
42 #include "platform/graphics/GraphicsScreen.h"
42 #include "platform/graphics/Image.h" 43 #include "platform/graphics/Image.h"
43 #include "platform/graphics/LinkHighlight.h" 44 #include "platform/graphics/LinkHighlight.h"
44 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" 45 #include "platform/graphics/filters/SkiaImageFilterBuilder.h"
45 #include "platform/graphics/paint/DrawingRecorder.h" 46 #include "platform/graphics/paint/DrawingRecorder.h"
46 #include "platform/graphics/paint/PaintController.h" 47 #include "platform/graphics/paint/PaintController.h"
47 #include "platform/scroll/ScrollableArea.h" 48 #include "platform/scroll/ScrollableArea.h"
48 #include "platform/text/TextStream.h" 49 #include "platform/text/TextStream.h"
49 #include "public/platform/Platform.h" 50 #include "public/platform/Platform.h"
50 #include "public/platform/WebCompositorAnimation.h" 51 #include "public/platform/WebCompositorAnimation.h"
51 #include "public/platform/WebCompositorSupport.h" 52 #include "public/platform/WebCompositorSupport.h"
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 { 1055 {
1055 if (rect == m_contentsRect) 1056 if (rect == m_contentsRect)
1056 return; 1057 return;
1057 1058
1058 m_contentsRect = rect; 1059 m_contentsRect = rect;
1059 updateContentsRect(); 1060 updateContentsRect();
1060 } 1061 }
1061 1062
1062 void GraphicsLayer::setContentsToImage(Image* image, RespectImageOrientationEnum respectImageOrientation) 1063 void GraphicsLayer::setContentsToImage(Image* image, RespectImageOrientationEnum respectImageOrientation)
1063 { 1064 {
1065 if (image && imageColorProfilesEnabled() && image->isBitmapImage() && toBitm apImage(image)->hasColorProfile()) {
1066 toBitmapImage(image)->notifyDeviceProfile(screenColorProfile(currentScre enId()).get());
1067 RELEASE_ASSERT(currentScreenId());
1068 }
1069
1064 RefPtr<SkImage> skImage = image ? image->imageForCurrentFrame() : nullptr; 1070 RefPtr<SkImage> skImage = image ? image->imageForCurrentFrame() : nullptr;
1065 1071
1066 if (image && skImage && image->isBitmapImage()) { 1072 if (skImage && image->isBitmapImage()) {
1067 if (respectImageOrientation == RespectImageOrientation) { 1073 if (respectImageOrientation == RespectImageOrientation) {
1068 ImageOrientation imageOrientation = toBitmapImage(image)->currentFra meOrientation(); 1074 ImageOrientation imageOrientation = toBitmapImage(image)->currentFra meOrientation();
1069 skImage = DragImage::resizeAndOrientImage(skImage.release(), imageOr ientation); 1075 skImage = DragImage::resizeAndOrientImage(skImage.release(), imageOr ientation);
1070 } 1076 }
1071 } 1077 }
1072 1078
1073 if (image && skImage) { 1079 if (image && skImage) {
1074 if (!m_imageLayer) { 1080 if (!m_imageLayer) {
1075 m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->cr eateImageLayer()); 1081 m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->cr eateImageLayer());
1076 registerContentsLayer(m_imageLayer->layer()); 1082 registerContentsLayer(m_imageLayer->layer());
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 { 1227 {
1222 if (!layer) { 1228 if (!layer) {
1223 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1229 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1224 return; 1230 return;
1225 } 1231 }
1226 1232
1227 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1233 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1228 fprintf(stderr, "%s\n", output.utf8().data()); 1234 fprintf(stderr, "%s\n", output.utf8().data());
1229 } 1235 }
1230 #endif 1236 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698