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

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

Issue 2425113002: Fix the linear-rgb canvas color space so that it renders (Closed)
Patch Set: Created 4 years, 2 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 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef ImageBufferSurface_h 31 #ifndef ImageBufferSurface_h
32 #define ImageBufferSurface_h 32 #define ImageBufferSurface_h
33 33
34 #include "platform/PlatformExport.h" 34 #include "platform/PlatformExport.h"
35 #include "platform/geometry/IntSize.h" 35 #include "platform/geometry/IntSize.h"
36 #include "platform/graphics/GraphicsTypes.h" 36 #include "platform/graphics/GraphicsTypes.h"
37 #include "third_party/khronos/GLES2/gl2.h" 37 #include "third_party/khronos/GLES2/gl2.h"
38 #include "third_party/skia/include/core/SkImageInfo.h"
38 #include "third_party/skia/include/core/SkPaint.h" 39 #include "third_party/skia/include/core/SkPaint.h"
39 #include "third_party/skia/include/core/SkRefCnt.h" 40 #include "third_party/skia/include/core/SkRefCnt.h"
40 #include "wtf/Allocator.h" 41 #include "wtf/Allocator.h"
41 #include "wtf/Noncopyable.h" 42 #include "wtf/Noncopyable.h"
42 43
43 class SkBitmap; 44 class SkBitmap;
44 class SkCanvas; 45 class SkCanvas;
45 class SkColorSpace; 46 class SkColorSpace;
46 class SkImage; 47 class SkImage;
47 struct SkImageInfo; 48 struct SkImageInfo;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 int x, 98 int x,
98 int y); 99 int y);
99 100
100 // May return nullptr if the surface is GPU-backed and the GPU context was 101 // May return nullptr if the surface is GPU-backed and the GPU context was
101 // lost. 102 // lost.
102 virtual sk_sp<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason) = 0; 103 virtual sk_sp<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason) = 0;
103 104
104 OpacityMode getOpacityMode() const { return m_opacityMode; } 105 OpacityMode getOpacityMode() const { return m_opacityMode; }
105 const IntSize& size() const { return m_size; } 106 const IntSize& size() const { return m_size; }
106 const sk_sp<SkColorSpace> colorSpace() const { return m_colorSpace; } 107 const sk_sp<SkColorSpace> colorSpace() const { return m_colorSpace; }
108 SkColorType colorType() const { return m_colorType; }
107 void notifyIsValidChanged(bool isValid) const; 109 void notifyIsValidChanged(bool isValid) const;
108 110
109 protected: 111 protected:
110 ImageBufferSurface(const IntSize&, OpacityMode, sk_sp<SkColorSpace>); 112 ImageBufferSurface(const IntSize&,
113 OpacityMode,
114 sk_sp<SkColorSpace>,
115 SkColorType);
111 void clear(); 116 void clear();
112 117
113 private: 118 private:
114 OpacityMode m_opacityMode; 119 OpacityMode m_opacityMode;
115 IntSize m_size; 120 IntSize m_size;
116 sk_sp<SkColorSpace> m_colorSpace; 121 sk_sp<SkColorSpace> m_colorSpace;
122 SkColorType m_colorType;
117 }; 123 };
118 124
119 } // namespace blink 125 } // namespace blink
120 126
121 #endif 127 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698