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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h

Issue 2212163002: Add some plumbing for the color management of canvases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 4 years, 4 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 21 matching lines...) Expand all
32 #define Canvas2DImageBufferSurface_h 32 #define Canvas2DImageBufferSurface_h
33 33
34 #include "platform/graphics/Canvas2DLayerBridge.h" 34 #include "platform/graphics/Canvas2DLayerBridge.h"
35 #include "platform/graphics/ImageBufferSurface.h" 35 #include "platform/graphics/ImageBufferSurface.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 // This shim necessary because ImageBufferSurfaces are not allowed to be RefCoun ted 39 // This shim necessary because ImageBufferSurfaces are not allowed to be RefCoun ted
40 class Canvas2DImageBufferSurface final : public ImageBufferSurface { 40 class Canvas2DImageBufferSurface final : public ImageBufferSurface {
41 public: 41 public:
42 Canvas2DImageBufferSurface(std::unique_ptr<WebGraphicsContext3DProvider> con textProvider, const IntSize& size, int msaaSampleCount, OpacityMode opacityMode, Canvas2DLayerBridge::AccelerationMode accelerationMode) 42 Canvas2DImageBufferSurface(std::unique_ptr<WebGraphicsContext3DProvider> con textProvider, const IntSize& size, int msaaSampleCount, OpacityMode opacityMode, Canvas2DLayerBridge::AccelerationMode accelerationMode, sk_sp<SkColorSpace> col orSpace)
43 : ImageBufferSurface(size, opacityMode) 43 : ImageBufferSurface(size, opacityMode, colorSpace)
44 , m_layerBridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvid er), size, msaaSampleCount, opacityMode, accelerationMode))) 44 , m_layerBridge(adoptRef(new Canvas2DLayerBridge(std::move(contextProvid er), size, msaaSampleCount, opacityMode, accelerationMode, colorSpace)))
45 { 45 {
46 init(); 46 init();
47 } 47 }
48 48
49 Canvas2DImageBufferSurface(PassRefPtr<Canvas2DLayerBridge> bridge, const Int Size& size) 49 Canvas2DImageBufferSurface(PassRefPtr<Canvas2DLayerBridge> bridge, const Int Size& size)
50 : ImageBufferSurface(size, bridge->opacityMode()) 50 : ImageBufferSurface(size, bridge->opacityMode(), bridge->colorSpace())
51 , m_layerBridge(std::move(bridge)) 51 , m_layerBridge(std::move(bridge))
52 { 52 {
53 init(); 53 init();
54 } 54 }
55 55
56 ~Canvas2DImageBufferSurface() override 56 ~Canvas2DImageBufferSurface() override
57 { 57 {
58 m_layerBridge->beginDestruction(); 58 m_layerBridge->beginDestruction();
59 } 59 }
60 60
(...skipping 24 matching lines...) Expand all
85 if (isValid()) 85 if (isValid())
86 m_layerBridge->flush(); 86 m_layerBridge->flush();
87 } 87 }
88 88
89 RefPtr<Canvas2DLayerBridge> m_layerBridge; 89 RefPtr<Canvas2DLayerBridge> m_layerBridge;
90 }; 90 };
91 91
92 } // namespace blink 92 } // namespace blink
93 93
94 #endif 94 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698