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

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

Issue 117703004: Free temporary GPU and memory resources held by inactive or hidden 2D canvases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: typo Created 6 years, 11 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) 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED; 74 WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED;
75 public: 75 public:
76 static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaqu e); 76 static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaqu e);
77 static PassOwnPtr<ImageBuffer> create(PassOwnPtr<ImageBufferSurface>); 77 static PassOwnPtr<ImageBuffer> create(PassOwnPtr<ImageBufferSurface>);
78 78
79 ~ImageBuffer(); 79 ~ImageBuffer();
80 80
81 const IntSize& size() const { return m_surface->size(); } 81 const IntSize& size() const { return m_surface->size(); }
82 bool isAccelerated() const { return m_surface->isAccelerated(); } 82 bool isAccelerated() const { return m_surface->isAccelerated(); }
83 83
84 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); }
85
84 GraphicsContext* context() const; 86 GraphicsContext* context() const;
85 87
86 const SkBitmap& bitmap() const; 88 const SkBitmap& bitmap() const;
87 89
88 PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavi or = Scaled) const; 90 PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavi or = Scaled) const;
89 // Give hints on the faster copyImage Mode, return DontCopyBackingStore if i t supports the DontCopyBackingStore behavior 91 // Give hints on the faster copyImage Mode, return DontCopyBackingStore if i t supports the DontCopyBackingStore behavior
90 // or return CopyBackingStore if it doesn't. 92 // or return CopyBackingStore if it doesn't.
91 static BackingStoreCopy fastCopyImageMode(); 93 static BackingStoreCopy fastCopyImageMode();
92 94
93 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&) const ; 95 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&) const ;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 137
136 IntSize m_size; 138 IntSize m_size;
137 RefPtr<Uint8ClampedArray> m_data; 139 RefPtr<Uint8ClampedArray> m_data;
138 }; 140 };
139 141
140 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality); 142 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality);
141 143
142 } // namespace WebCore 144 } // namespace WebCore
143 145
144 #endif // ImageBuffer_h 146 #endif // ImageBuffer_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/Canvas2DLayerManager.cpp ('k') | Source/platform/graphics/ImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698