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

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

Issue 562583002: Implement image-rendering:pixelated for accelerated 2D canvases. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change setNearestNeighbor to setFilterLevel, use SkPaint::FilterLevel. Created 6 years, 3 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 19 matching lines...) Expand all
30 30
31 #include "platform/PlatformExport.h" 31 #include "platform/PlatformExport.h"
32 #include "platform/geometry/FloatRect.h" 32 #include "platform/geometry/FloatRect.h"
33 #include "platform/geometry/IntSize.h" 33 #include "platform/geometry/IntSize.h"
34 #include "platform/graphics/Canvas2DLayerBridge.h" 34 #include "platform/graphics/Canvas2DLayerBridge.h"
35 #include "platform/graphics/ColorSpace.h" 35 #include "platform/graphics/ColorSpace.h"
36 #include "platform/graphics/GraphicsTypes.h" 36 #include "platform/graphics/GraphicsTypes.h"
37 #include "platform/graphics/GraphicsTypes3D.h" 37 #include "platform/graphics/GraphicsTypes3D.h"
38 #include "platform/graphics/ImageBufferSurface.h" 38 #include "platform/graphics/ImageBufferSurface.h"
39 #include "platform/transforms/AffineTransform.h" 39 #include "platform/transforms/AffineTransform.h"
40 #include "third_party/skia/include/core/SkPaint.h"
40 #include "wtf/Forward.h" 41 #include "wtf/Forward.h"
41 #include "wtf/OwnPtr.h" 42 #include "wtf/OwnPtr.h"
42 #include "wtf/PassOwnPtr.h" 43 #include "wtf/PassOwnPtr.h"
43 #include "wtf/PassRefPtr.h" 44 #include "wtf/PassRefPtr.h"
44 #include "wtf/Uint8ClampedArray.h" 45 #include "wtf/Uint8ClampedArray.h"
45 46
46 namespace blink { 47 namespace blink {
47 48
48 class DrawingBuffer; 49 class DrawingBuffer;
49 class GraphicsContext; 50 class GraphicsContext;
(...skipping 26 matching lines...) Expand all
76 77
77 ~ImageBuffer(); 78 ~ImageBuffer();
78 79
79 void setClient(ImageBufferClient* client) { m_client = client; } 80 void setClient(ImageBufferClient* client) { m_client = client; }
80 81
81 const IntSize& size() const { return m_surface->size(); } 82 const IntSize& size() const { return m_surface->size(); }
82 bool isAccelerated() const { return m_surface->isAccelerated(); } 83 bool isAccelerated() const { return m_surface->isAccelerated(); }
83 bool isSurfaceValid() const; 84 bool isSurfaceValid() const;
84 bool restoreSurface() const; 85 bool restoreSurface() const;
85 86
87 void setFilterLevel(SkPaint::FilterLevel filterLevel) { m_surface->setFilter Level(filterLevel); }
86 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); } 88 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); }
87 89
88 GraphicsContext* context() const; 90 GraphicsContext* context() const;
89 91
90 // Called at the end of a task that rendered a whole frame 92 // Called at the end of a task that rendered a whole frame
91 void finalizeFrame(const FloatRect &dirtyRect); 93 void finalizeFrame(const FloatRect &dirtyRect);
92 void didFinalizeFrame(); 94 void didFinalizeFrame();
93 95
94 bool isDirty(); 96 bool isDirty();
95 97
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 150
149 IntSize m_size; 151 IntSize m_size;
150 RefPtr<Uint8ClampedArray> m_data; 152 RefPtr<Uint8ClampedArray> m_data;
151 }; 153 };
152 154
153 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality); 155 String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality);
154 156
155 } // namespace blink 157 } // namespace blink
156 158
157 #endif // ImageBuffer_h 159 #endif // ImageBuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698