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

Side by Side Diff: Source/platform/graphics/skia/NativeImageSkia.h

Issue 352873002: [wip] image color correction (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 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 24 matching lines...) Expand all
35 #include "SkRect.h" 35 #include "SkRect.h"
36 #include "SkSize.h" 36 #include "SkSize.h"
37 #include "SkXfermode.h" 37 #include "SkXfermode.h"
38 #include "platform/PlatformExport.h" 38 #include "platform/PlatformExport.h"
39 #include "platform/geometry/IntSize.h" 39 #include "platform/geometry/IntSize.h"
40 #include "platform/graphics/GraphicsTypes.h" 40 #include "platform/graphics/GraphicsTypes.h"
41 #include "wtf/Forward.h" 41 #include "wtf/Forward.h"
42 #include "wtf/PassRefPtr.h" 42 #include "wtf/PassRefPtr.h"
43 #include "wtf/RefCounted.h" 43 #include "wtf/RefCounted.h"
44 44
45 class SkColorFilter;
45 class SkMatrix; 46 class SkMatrix;
46 class SkPaint; 47 class SkPaint;
47 48
48 namespace WebCore { 49 namespace WebCore {
49 50
50 class FloatPoint; 51 class FloatPoint;
51 class FloatRect; 52 class FloatRect;
52 class FloatSize; 53 class FloatSize;
53 class GraphicsContext; 54 class GraphicsContext;
54 55
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // This will return an existing resized image subset, or generate a new one 99 // This will return an existing resized image subset, or generate a new one
99 // of the specified size and subset and possibly cache it. 100 // of the specified size and subset and possibly cache it.
100 // 101 //
101 // scaledImageSize 102 // scaledImageSize
102 // Dimensions of the scaled full image. 103 // Dimensions of the scaled full image.
103 // 104 //
104 // scaledImageSubset 105 // scaledImageSubset
105 // Rectangle of the subset in the scaled image. 106 // Rectangle of the subset in the scaled image.
106 SkBitmap resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaled ImageSubset) const; 107 SkBitmap resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaled ImageSubset) const;
107 108
108 void draw(GraphicsContext*, const SkRect& srcRect, const SkRect& destRect, P assRefPtr<SkXfermode>) const; 109 void draw(GraphicsContext*, const SkRect& srcRect, const SkRect& destRect, P assRefPtr<SkXfermode>, PassRefPtr<SkColorFilter> = nullptr) const;
109 void drawPattern( 110 void drawPattern(GraphicsContext*, const FloatRect& srcRect, const FloatSize & scale, const FloatPoint& phase, CompositeOperator, const FloatRect& destRect, blink::WebBlendMode, const IntSize& repeatSpacing, PassRefPtr<SkColorFilter> = n ullptr) const;
110 GraphicsContext*,
111 const FloatRect& srcRect,
112 const FloatSize& scale,
113 const FloatPoint& phase,
114 CompositeOperator,
115 const FloatRect& destRect,
116 blink::WebBlendMode,
117 const IntSize& repeatSpacing) const;
118 111
119 private: 112 private:
120 NativeImageSkia(); 113 NativeImageSkia();
121 114
122 NativeImageSkia(const SkBitmap&); 115 NativeImageSkia(const SkBitmap&);
123 116
124 // ImageResourceInfo is used to uniquely identify cached or requested image 117 // ImageResourceInfo is used to uniquely identify cached or requested image
125 // resizes. 118 // resizes.
126 // Image resize is identified by the scaled image size and scaled image subs et. 119 // Image resize is identified by the scaled image size and scaled image subs et.
127 struct ImageResourceInfo { 120 struct ImageResourceInfo {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // those requests individually are small and would not otherwise be cached. 168 // those requests individually are small and would not otherwise be cached.
176 // 169 //
177 // We also track scaling information and destination subset for the scaled 170 // We also track scaling information and destination subset for the scaled
178 // image. See comments for ImageResourceInfo. 171 // image. See comments for ImageResourceInfo.
179 mutable ImageResourceInfo m_cachedImageInfo; 172 mutable ImageResourceInfo m_cachedImageInfo;
180 mutable int m_resizeRequests; 173 mutable int m_resizeRequests;
181 }; 174 };
182 175
183 } 176 }
184 #endif // NativeImageSkia_h 177 #endif // NativeImageSkia_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698