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

Side by Side Diff: skia/ext/layer_allocator_win.h

Issue 2304273002: WIP RasterCanvasLayerAllocator experiment 2
Patch Set: update to Skia patchset 13 Created 4 years, 2 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
« no previous file with comments | « skia/ext/layer_allocator_cairo.cc ('k') | skia/ext/layer_allocator_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SKIA_EXT_LAYER_ALLOCATOR_WIN_H_
6 #define SKIA_EXT_LAYER_ALLOCATOR_WIN_H_
7
8 #include "skia/ext/platform_surface.h"
9
10 #include "third_party/skia/include/core/SkRasterCanvasLayerAllocator.h"
11
12 #include <unordered_map>
13
14 namespace skia {
15
16 /*
17 * On Windows, a PlatformCanvas is backed by a CreateDIBSection()-allocated
18 * bitmap; a PlatformSurface is an HDC.
19 */
20 class LayerAllocator : public SkRasterCanvasLayerAllocator {
21 public:
22 LayerAllocator();
23 ~LayerAllocator() override;
24
25 /// Returns HDC.
26 void* getNativeContext(void* buffer,
27 const SkMatrix& transform,
28 const SkIRect& clip_bounds) override;
29
30 protected:
31 /// Expects a HANDLE to a Windows shared section as (optional) initialData.
32 /// Returns the data pointer from an HBITMAP.
33 /// |deallocator| will ...() and ...()
34 /// the layer.
35 void* allocateLayer(const SkImageInfo& info, size_t* rowBytes,
36 void (**deallocator)(void*),
37 void** deallocatorPayload,
38 void* initialData) override;
39
40 private:
41 typedef std::unordered_map<void*, HDC> context_map_t;
42 context_map_t contexts_;
43
44 friend class BitmapPlatformDevice;
45 };
46
47 }
48
49 #endif // SKIA_EXT_LAYER_ALLOCATOR_WIN_H_
OLDNEW
« no previous file with comments | « skia/ext/layer_allocator_cairo.cc ('k') | skia/ext/layer_allocator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698