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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1796293003: Image decode color: Push color profile from browser to renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove prototype Created 4 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 #include "platform/exported/WebActiveGestureAnimation.h" 112 #include "platform/exported/WebActiveGestureAnimation.h"
113 #include "platform/fonts/FontCache.h" 113 #include "platform/fonts/FontCache.h"
114 #include "platform/graphics/Color.h" 114 #include "platform/graphics/Color.h"
115 #include "platform/graphics/CompositorFactory.h" 115 #include "platform/graphics/CompositorFactory.h"
116 #include "platform/graphics/FirstPaintInvalidationTracking.h" 116 #include "platform/graphics/FirstPaintInvalidationTracking.h"
117 #include "platform/graphics/GraphicsContext.h" 117 #include "platform/graphics/GraphicsContext.h"
118 #include "platform/graphics/Image.h" 118 #include "platform/graphics/Image.h"
119 #include "platform/graphics/ImageBuffer.h" 119 #include "platform/graphics/ImageBuffer.h"
120 #include "platform/graphics/gpu/DrawingBuffer.h" 120 #include "platform/graphics/gpu/DrawingBuffer.h"
121 #include "platform/graphics/paint/DrawingRecorder.h" 121 #include "platform/graphics/paint/DrawingRecorder.h"
122 #include "platform/image-decoders/ImageDecoder.h"
122 #include "platform/scroll/ScrollbarTheme.h" 123 #include "platform/scroll/ScrollbarTheme.h"
123 #include "platform/weborigin/SchemeRegistry.h" 124 #include "platform/weborigin/SchemeRegistry.h"
124 #include "public/platform/Platform.h" 125 #include "public/platform/Platform.h"
125 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" 126 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h"
126 #include "public/platform/WebCompositorSupport.h" 127 #include "public/platform/WebCompositorSupport.h"
127 #include "public/platform/WebDragData.h" 128 #include "public/platform/WebDragData.h"
128 #include "public/platform/WebFloatPoint.h" 129 #include "public/platform/WebFloatPoint.h"
129 #include "public/platform/WebGestureCurve.h" 130 #include "public/platform/WebGestureCurve.h"
130 #include "public/platform/WebImage.h" 131 #include "public/platform/WebImage.h"
131 #include "public/platform/WebLayerTreeView.h" 132 #include "public/platform/WebLayerTreeView.h"
(...skipping 3051 matching lines...) Expand 10 before | Expand all | Expand 10 after
3183 void WebViewImpl::setZoomFactorForDeviceScaleFactor(float zoomFactorForDeviceSca leFactor) 3184 void WebViewImpl::setZoomFactorForDeviceScaleFactor(float zoomFactorForDeviceSca leFactor)
3184 { 3185 {
3185 m_zoomFactorForDeviceScaleFactor = zoomFactorForDeviceScaleFactor; 3186 m_zoomFactorForDeviceScaleFactor = zoomFactorForDeviceScaleFactor;
3186 if (!m_layerTreeView) 3187 if (!m_layerTreeView)
3187 return; 3188 return;
3188 setZoomLevel(m_zoomLevel); 3189 setZoomLevel(m_zoomLevel);
3189 } 3190 }
3190 3191
3191 void WebViewImpl::setDeviceColorProfile(const WebVector<char>& colorProfile) 3192 void WebViewImpl::setDeviceColorProfile(const WebVector<char>& colorProfile)
3192 { 3193 {
3193 if (!page())
3194 return;
3195
3196 Vector<char> deviceProfile; 3194 Vector<char> deviceProfile;
3197 deviceProfile.append(colorProfile.data(), colorProfile.size()); 3195 deviceProfile.append(colorProfile.data(), colorProfile.size());
3198 3196
3199 page()->setDeviceColorProfile(deviceProfile); 3197 ImageDecoder::setOutputDeviceColorProfile(deviceProfile);
3198
3199 if (page())
dcheng 2016/03/15 17:28:08 Why not early return if page() is null? Doesn't th
ccameron 2016/03/15 18:22:05 Oh, if that's only-at-exit, then yes, this should
3200 page()->setDeviceColorProfile(deviceProfile);
3200 } 3201 }
3201 3202
3202 void WebViewImpl::resetDeviceColorProfileForTesting() 3203 void WebViewImpl::resetDeviceColorProfileForTesting()
3203 { 3204 {
3204 if (!page()) 3205 if (!page())
3205 return; 3206 return;
3206 3207
3207 page()->resetDeviceColorProfileForTesting(); 3208 page()->resetDeviceColorProfileForTesting();
3208 } 3209 }
3209 3210
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
4569 { 4570 {
4570 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4571 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4571 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4572 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4572 if (!page()) 4573 if (!page())
4573 return 1; 4574 return 1;
4574 4575
4575 return page()->deviceScaleFactor(); 4576 return page()->deviceScaleFactor();
4576 } 4577 }
4577 4578
4578 } // namespace blink 4579 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698