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

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

Issue 2255683005: Determine if OffscreenCanvas is paintable in different rendering contexts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Canvas2DTypecast
Patch Set: enum Created 4 years, 4 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 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 WTF_MAKE_NONCOPYABLE(ImageBuffer); 75 WTF_MAKE_NONCOPYABLE(ImageBuffer);
76 USING_FAST_MALLOC(ImageBuffer); 76 USING_FAST_MALLOC(ImageBuffer);
77 public: 77 public:
78 static std::unique_ptr<ImageBuffer> create(const IntSize&, OpacityMode = Non Opaque, ImageInitializationMode = InitializeImagePixels); 78 static std::unique_ptr<ImageBuffer> create(const IntSize&, OpacityMode = Non Opaque, ImageInitializationMode = InitializeImagePixels);
79 static std::unique_ptr<ImageBuffer> create(std::unique_ptr<ImageBufferSurfac e>); 79 static std::unique_ptr<ImageBuffer> create(std::unique_ptr<ImageBufferSurfac e>);
80 80
81 virtual ~ImageBuffer(); 81 virtual ~ImageBuffer();
82 82
83 void setClient(ImageBufferClient* client) { m_client = client; } 83 void setClient(ImageBufferClient* client) { m_client = client; }
84 84
85 static bool canCreateImageBuffer(const IntSize&);
85 const IntSize& size() const { return m_surface->size(); } 86 const IntSize& size() const { return m_surface->size(); }
86 bool isAccelerated() const { return m_surface->isAccelerated(); } 87 bool isAccelerated() const { return m_surface->isAccelerated(); }
87 bool isRecording() const { return m_surface->isRecording(); } 88 bool isRecording() const { return m_surface->isRecording(); }
88 void setHasExpensiveOp() { m_surface->setHasExpensiveOp(); } 89 void setHasExpensiveOp() { m_surface->setHasExpensiveOp(); }
89 bool isExpensiveToPaint() const { return m_surface->isExpensiveToPaint(); } 90 bool isExpensiveToPaint() const { return m_surface->isExpensiveToPaint(); }
90 void prepareSurfaceForPaintingIfNeeded() { m_surface->prepareSurfaceForPaint ingIfNeeded(); } 91 void prepareSurfaceForPaintingIfNeeded() { m_surface->prepareSurfaceForPaint ingIfNeeded(); }
91 bool isSurfaceValid() const; 92 bool isSurfaceValid() const;
92 bool restoreSurface() const; 93 bool restoreSurface() const;
93 void didDraw(const FloatRect&) const; 94 void didDraw(const FloatRect&) const;
94 bool wasDrawnToAfterSnapshot() const { return m_snapshotState == DrawnToAfte rSnapshot; } 95 bool wasDrawnToAfterSnapshot() const { return m_snapshotState == DrawnToAfte rSnapshot; }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 int height() const { return m_size.height(); } 179 int height() const { return m_size.height(); }
179 int width() const { return m_size.width(); } 180 int width() const { return m_size.width(); }
180 181
181 const unsigned char* m_data; 182 const unsigned char* m_data;
182 const IntSize m_size; 183 const IntSize m_size;
183 }; 184 };
184 185
185 } // namespace blink 186 } // namespace blink
186 187
187 #endif // ImageBuffer_h 188 #endif // ImageBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698