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

Side by Side Diff: third_party/WebKit/Source/core/html/ImageData.h

Issue 2849643002: Implement ImageData::CropRect() (Closed)
Patch Set: Rebaseline Created 3 years, 6 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) 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 21 matching lines...) Expand all
32 #include "bindings/core/v8/Uint8ClampedArrayOrUint16ArrayOrFloat32Array.h" 32 #include "bindings/core/v8/Uint8ClampedArrayOrUint16ArrayOrFloat32Array.h"
33 #include "core/CoreExport.h" 33 #include "core/CoreExport.h"
34 #include "core/dom/ArrayBufferViewHelpers.h" 34 #include "core/dom/ArrayBufferViewHelpers.h"
35 #include "core/dom/DOMTypedArray.h" 35 #include "core/dom/DOMTypedArray.h"
36 #include "core/html/ImageDataColorSettings.h" 36 #include "core/html/ImageDataColorSettings.h"
37 #include "core/html/canvas/CanvasRenderingContext.h" 37 #include "core/html/canvas/CanvasRenderingContext.h"
38 #include "core/imagebitmap/ImageBitmapSource.h" 38 #include "core/imagebitmap/ImageBitmapSource.h"
39 #include "platform/bindings/ScriptWrappable.h" 39 #include "platform/bindings/ScriptWrappable.h"
40 #include "platform/geometry/IntRect.h" 40 #include "platform/geometry/IntRect.h"
41 #include "platform/geometry/IntSize.h" 41 #include "platform/geometry/IntSize.h"
42 #include "platform/graphics/CanvasColorParams.h"
42 #include "platform/heap/Handle.h" 43 #include "platform/heap/Handle.h"
43 #include "platform/wtf/CheckedNumeric.h" 44 #include "platform/wtf/CheckedNumeric.h"
44 #include "platform/wtf/Compiler.h" 45 #include "platform/wtf/Compiler.h"
45 #include "platform/wtf/text/WTFString.h" 46 #include "platform/wtf/text/WTFString.h"
46 #include "third_party/skia/include/core/SkColorSpace.h" 47 #include "third_party/skia/include/core/SkColorSpace.h"
47 48
48 namespace blink { 49 namespace blink {
49 50
50 class ExceptionState; 51 class ExceptionState;
51 class ImageBitmapOptions; 52 class ImageBitmapOptions;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 ExceptionState&); 102 ExceptionState&);
102 103
103 void getColorSettings(ImageDataColorSettings& result) { 104 void getColorSettings(ImageDataColorSettings& result) {
104 result = color_settings_; 105 result = color_settings_;
105 } 106 }
106 107
107 static ImageData* CreateForTest(const IntSize&); 108 static ImageData* CreateForTest(const IntSize&);
108 static ImageData* CreateForTest(const IntSize&, 109 static ImageData* CreateForTest(const IntSize&,
109 DOMArrayBufferView*, 110 DOMArrayBufferView*,
110 const ImageDataColorSettings* = nullptr); 111 const ImageDataColorSettings* = nullptr);
111 static sk_sp<SkColorSpace> GetSkColorSpaceForTest(const CanvasColorSpace&, 112
112 const CanvasPixelFormat&); 113 ImageData* CropRect(const IntRect&, bool = false);
113 114
114 static CanvasColorSpace GetCanvasColorSpace(const String&); 115 static CanvasColorSpace GetCanvasColorSpace(const String&);
115 static String CanvasColorSpaceName(const CanvasColorSpace&); 116 static String CanvasColorSpaceName(const CanvasColorSpace&);
116 static ImageDataStorageFormat GetImageDataStorageFormat(const String&); 117 static ImageDataStorageFormat GetImageDataStorageFormat(const String&);
117 static unsigned StorageFormatDataSize(const String&); 118 static unsigned StorageFormatDataSize(const String&);
118 static DOMArrayBufferView* 119 static DOMArrayBufferView*
119 ConvertPixelsFromCanvasPixelFormatToImageDataStorageFormat( 120 ConvertPixelsFromCanvasPixelFormatToImageDataStorageFormat(
120 WTF::ArrayBufferContents&, 121 WTF::ArrayBufferContents&,
121 CanvasPixelFormat, 122 CanvasPixelFormat,
122 ImageDataStorageFormat); 123 ImageDataStorageFormat);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 static DOMUint16Array* AllocateAndValidateUint16Array( 187 static DOMUint16Array* AllocateAndValidateUint16Array(
187 const unsigned&, 188 const unsigned&,
188 ExceptionState* = nullptr); 189 ExceptionState* = nullptr);
189 190
190 static DOMFloat32Array* AllocateAndValidateFloat32Array( 191 static DOMFloat32Array* AllocateAndValidateFloat32Array(
191 const unsigned&, 192 const unsigned&,
192 ExceptionState* = nullptr); 193 ExceptionState* = nullptr);
193 194
194 static DOMFloat32Array* ConvertFloat16ArrayToFloat32Array(const uint16_t*, 195 static DOMFloat32Array* ConvertFloat16ArrayToFloat32Array(const uint16_t*,
195 unsigned); 196 unsigned);
196
197 static sk_sp<SkColorSpace> GetSkColorSpace(const CanvasColorSpace&,
198 const CanvasPixelFormat&);
199 }; 197 };
200 198
201 } // namespace blink 199 } // namespace blink
202 200
203 #endif // ImageData_h 201 #endif // ImageData_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/ImageData.cpp » ('j') | third_party/WebKit/Source/core/html/ImageData.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698