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

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

Issue 2026803002: Avoid GPU readback in tex(Sub)Image2D(ImageBitmap) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout test timeout in a strange way Created 4 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) 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 16 matching lines...) Expand all
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/ImageObserver.h" 35 #include "platform/graphics/ImageObserver.h"
36 #include "platform/graphics/ImageOrientation.h" 36 #include "platform/graphics/ImageOrientation.h"
37 #include "public/platform/WebGraphicsContext3DProvider.h"
37 #include "wtf/Assertions.h" 38 #include "wtf/Assertions.h"
38 #include "wtf/Noncopyable.h" 39 #include "wtf/Noncopyable.h"
39 #include "wtf/PassRefPtr.h" 40 #include "wtf/PassRefPtr.h"
40 #include "wtf/RefCounted.h" 41 #include "wtf/RefCounted.h"
41 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
42 #include "wtf/text/WTFString.h" 43 #include "wtf/text/WTFString.h"
43 44
44 class SkBitmap; 45 class SkBitmap;
45 class SkCanvas; 46 class SkCanvas;
46 class SkImage; 47 class SkImage;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 virtual void advanceAnimationForTesting() { } 131 virtual void advanceAnimationForTesting() { }
131 132
132 // Typically the ImageResource that owns us. 133 // Typically the ImageResource that owns us.
133 ImageObserver* getImageObserver() const { return m_imageObserverDisabled ? n ullptr : m_imageObserver; } 134 ImageObserver* getImageObserver() const { return m_imageObserverDisabled ? n ullptr : m_imageObserver; }
134 void clearImageObserver() { m_imageObserver = nullptr; } 135 void clearImageObserver() { m_imageObserver = nullptr; }
135 // Do not call setImageObserverDisabled() other than from ImageObserverDisab ler to avoid interleaved accesses to |m_imageObserverDisabled|. 136 // Do not call setImageObserverDisabled() other than from ImageObserverDisab ler to avoid interleaved accesses to |m_imageObserverDisabled|.
136 void setImageObserverDisabled(bool disabled) { m_imageObserverDisabled = dis abled; } 137 void setImageObserverDisabled(bool disabled) { m_imageObserverDisabled = dis abled; }
137 138
138 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; 139 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
139 140
140 virtual PassRefPtr<SkImage> imageForCurrentFrame() = 0; 141 // The returned SkImage may or may not be texture-backed. If the caller need s a texture-backed
142 // image in a 3D context such as WebGL context, it must specify the desired context provider.
143 virtual PassRefPtr<SkImage> imageForCurrentFrame(WebGraphicsContext3DProvide r* = nullptr) = 0;
f(malita) 2016/06/15 12:39:32 Looks like we only ever pass a WebGraphicsContext3
141 virtual PassRefPtr<Image> imageForDefaultFrame(); 144 virtual PassRefPtr<Image> imageForDefaultFrame();
142 145
143 virtual void drawPattern(GraphicsContext&, const FloatRect&, 146 virtual void drawPattern(GraphicsContext&, const FloatRect&,
144 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode, 147 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode,
145 const FloatRect&, const FloatSize& repeatSpacing = FloatSize()); 148 const FloatRect&, const FloatSize& repeatSpacing = FloatSize());
146 149
147 enum ImageClampingMode { 150 enum ImageClampingMode {
148 ClampImageToSourceRect, 151 ClampImageToSourceRect,
149 DoNotClampImageToSourceRect 152 DoNotClampImageToSourceRect
150 }; 153 };
(...skipping 30 matching lines...) Expand all
181 UntracedMember<ImageObserver> m_imageObserver; 184 UntracedMember<ImageObserver> m_imageObserver;
182 bool m_imageObserverDisabled; 185 bool m_imageObserverDisabled;
183 }; 186 };
184 187
185 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 188 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
186 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) 189 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName())
187 190
188 } // namespace blink 191 } // namespace blink
189 192
190 #endif 193 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698