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

Side by Side Diff: Source/platform/graphics/Image.h

Issue 1001703003: Take NativeImageSkia out behind the woodshed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Switch to skia-style API (return bool instead of SkBitmap) Created 5 years, 9 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
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.cpp ('k') | Source/platform/graphics/Image.cpp » ('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) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 15 matching lines...) Expand all
26 26
27 #ifndef Image_h 27 #ifndef Image_h
28 #define Image_h 28 #define Image_h
29 29
30 #include "platform/PlatformExport.h" 30 #include "platform/PlatformExport.h"
31 #include "platform/geometry/IntRect.h" 31 #include "platform/geometry/IntRect.h"
32 #include "platform/graphics/Color.h" 32 #include "platform/graphics/Color.h"
33 #include "platform/graphics/GraphicsTypes.h" 33 #include "platform/graphics/GraphicsTypes.h"
34 #include "platform/graphics/ImageAnimationPolicy.h" 34 #include "platform/graphics/ImageAnimationPolicy.h"
35 #include "platform/graphics/ImageOrientation.h" 35 #include "platform/graphics/ImageOrientation.h"
36 #include "platform/graphics/skia/NativeImageSkia.h"
37 #include "third_party/skia/include/core/SkXfermode.h" 36 #include "third_party/skia/include/core/SkXfermode.h"
38 #include "wtf/Assertions.h" 37 #include "wtf/Assertions.h"
39 #include "wtf/PassRefPtr.h" 38 #include "wtf/PassRefPtr.h"
40 #include "wtf/RefCounted.h" 39 #include "wtf/RefCounted.h"
41 #include "wtf/RefPtr.h" 40 #include "wtf/RefPtr.h"
42 #include "wtf/RetainPtr.h" 41 #include "wtf/RetainPtr.h"
43 #include "wtf/text/WTFString.h" 42 #include "wtf/text/WTFString.h"
44 43
44 class SkBitmap;
45 class SkImage; 45 class SkImage;
46 46
47 namespace blink { 47 namespace blink {
48 48
49 class FloatPoint; 49 class FloatPoint;
50 class FloatRect; 50 class FloatRect;
51 class FloatSize; 51 class FloatSize;
52 class GraphicsContext; 52 class GraphicsContext;
53 class Length; 53 class Length;
54 class SharedBuffer; 54 class SharedBuffer;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // Set animationPolicy 119 // Set animationPolicy
120 virtual void setAnimationPolicy(ImageAnimationPolicy) { } 120 virtual void setAnimationPolicy(ImageAnimationPolicy) { }
121 virtual ImageAnimationPolicy animationPolicy() { return ImageAnimationPolicy Allowed; } 121 virtual ImageAnimationPolicy animationPolicy() { return ImageAnimationPolicy Allowed; }
122 122
123 // Typically the ImageResource that owns us. 123 // Typically the ImageResource that owns us.
124 ImageObserver* imageObserver() const { return m_imageObserver; } 124 ImageObserver* imageObserver() const { return m_imageObserver; }
125 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; } 125 void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; }
126 126
127 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; 127 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
128 128
129 virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return nu llptr; } 129 virtual bool bitmapForCurrentFrame(SkBitmap*) WARN_UNUSED_RETURN;
130 130
131 virtual PassRefPtr<Image> imageForDefaultFrame(); 131 virtual PassRefPtr<Image> imageForDefaultFrame();
132 132
133 virtual void drawPattern(GraphicsContext*, const FloatRect&, 133 virtual void drawPattern(GraphicsContext*, const FloatRect&,
134 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode, 134 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode,
135 const FloatRect&, const IntSize& repeatSpacing = IntSize()); 135 const FloatRect&, const IntSize& repeatSpacing = IntSize());
136 136
137 #if ENABLE(ASSERT) 137 #if ENABLE(ASSERT)
138 virtual bool notSolidColor() { return true; } 138 virtual bool notSolidColor() { return true; }
139 #endif 139 #endif
(...skipping 17 matching lines...) Expand all
157 RefPtr<SharedBuffer> m_encodedImageData; 157 RefPtr<SharedBuffer> m_encodedImageData;
158 ImageObserver* m_imageObserver; 158 ImageObserver* m_imageObserver;
159 }; 159 };
160 160
161 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 161 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
162 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) 162 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName())
163 163
164 } // namespace blink 164 } // namespace blink
165 165
166 #endif 166 #endif
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.cpp ('k') | Source/platform/graphics/Image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698