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

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

Issue 2525453002: Raster: Allow a RasterSource to specify its color space (Closed)
Patch Set: Only set implied space when color correct rendering is disabled 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
« no previous file with comments | « cc/tiles/tile_manager.cc ('k') | third_party/WebKit/public/platform/WebDisplayItemList.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 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 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 12 matching lines...) Expand all
23 * DAMAGE. 23 * DAMAGE.
24 */ 24 */
25 25
26 #include "platform/graphics/ContentLayerDelegate.h" 26 #include "platform/graphics/ContentLayerDelegate.h"
27 27
28 #include "platform/RuntimeEnabledFeatures.h" 28 #include "platform/RuntimeEnabledFeatures.h"
29 #include "platform/geometry/IntRect.h" 29 #include "platform/geometry/IntRect.h"
30 #include "platform/graphics/GraphicsContext.h" 30 #include "platform/graphics/GraphicsContext.h"
31 #include "platform/graphics/GraphicsLayer.h" 31 #include "platform/graphics/GraphicsLayer.h"
32 #include "platform/graphics/paint/PaintController.h" 32 #include "platform/graphics/paint/PaintController.h"
33 #include "platform/image-decoders/ImageDecoder.h"
33 #include "platform/tracing/TraceEvent.h" 34 #include "platform/tracing/TraceEvent.h"
34 #include "platform/tracing/TracedValue.h" 35 #include "platform/tracing/TracedValue.h"
35 #include "public/platform/WebDisplayItemList.h" 36 #include "public/platform/WebDisplayItemList.h"
36 #include "public/platform/WebRect.h" 37 #include "public/platform/WebRect.h"
37 #include "third_party/skia/include/core/SkPicture.h" 38 #include "third_party/skia/include/core/SkPicture.h"
39 #include "ui/gfx/color_space.h"
38 #include "ui/gfx/geometry/rect.h" 40 #include "ui/gfx/geometry/rect.h"
39 41
40 namespace blink { 42 namespace blink {
41 43
42 ContentLayerDelegate::ContentLayerDelegate(GraphicsLayer* graphicsLayer) 44 ContentLayerDelegate::ContentLayerDelegate(GraphicsLayer* graphicsLayer)
43 : m_graphicsLayer(graphicsLayer) {} 45 : m_graphicsLayer(graphicsLayer) {}
44 46
45 ContentLayerDelegate::~ContentLayerDelegate() {} 47 ContentLayerDelegate::~ContentLayerDelegate() {}
46 48
47 gfx::Rect ContentLayerDelegate::paintableRegion() { 49 gfx::Rect ContentLayerDelegate::paintableRegion() {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Anything other than PaintDefaultBehavior is for testing. In non-testing 83 // Anything other than PaintDefaultBehavior is for testing. In non-testing
82 // scenarios, it is an error to call GraphicsLayer::paint. Actual painting 84 // scenarios, it is an error to call GraphicsLayer::paint. Actual painting
83 // occurs in FrameView::synchronizedPaint; this method merely copies the 85 // occurs in FrameView::synchronizedPaint; this method merely copies the
84 // painted output to the WebDisplayItemList. 86 // painted output to the WebDisplayItemList.
85 if (paintingControl != PaintDefaultBehavior) 87 if (paintingControl != PaintDefaultBehavior)
86 m_graphicsLayer->paint(nullptr, disabledMode); 88 m_graphicsLayer->paint(nullptr, disabledMode);
87 89
88 paintController.paintArtifact().appendToWebDisplayItemList( 90 paintController.paintArtifact().appendToWebDisplayItemList(
89 webDisplayItemList); 91 webDisplayItemList);
90 92
93 if (!RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) {
94 // TODO(ccameron): This color space should come from the GraphicsLayer.
95 // https://crbug.com/667411
96 webDisplayItemList->setImpliedColorSpace(gfx::ColorSpace::FromSkColorSpace(
97 ImageDecoder::globalTargetColorSpace()));
98 }
91 paintController.setDisplayItemConstructionIsDisabled(false); 99 paintController.setDisplayItemConstructionIsDisabled(false);
92 paintController.setSubsequenceCachingIsDisabled(false); 100 paintController.setSubsequenceCachingIsDisabled(false);
93 } 101 }
94 102
95 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const { 103 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const {
96 return m_graphicsLayer->getPaintController().approximateUnsharedMemoryUsage(); 104 return m_graphicsLayer->getPaintController().approximateUnsharedMemoryUsage();
97 } 105 }
98 106
99 } // namespace blink 107 } // namespace blink
OLDNEW
« no previous file with comments | « cc/tiles/tile_manager.cc ('k') | third_party/WebKit/public/platform/WebDisplayItemList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698