OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_SKIA_H_ | 5 #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_SKIA_H_ |
6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_SKIA_H_ | 6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_SKIA_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "skia/ext/platform_device.h" | 13 #include "skia/ext/platform_device.h" |
14 | 14 |
15 namespace skia { | 15 namespace skia { |
16 | 16 |
17 class ScopedPlatformPaint; | |
18 | |
19 // ----------------------------------------------------------------------------- | 17 // ----------------------------------------------------------------------------- |
20 // For now we just use SkBitmap for SkBitmapDevice | 18 // For now we just use SkBitmap for SkBitmapDevice |
21 // | 19 // |
22 // This is all quite ok for test_shell. In the future we will want to use | 20 // This is all quite ok for test_shell. In the future we will want to use |
23 // shared memory between the renderer and the main process at least. In this | 21 // shared memory between the renderer and the main process at least. In this |
24 // case we'll probably create the buffer from a precreated region of memory. | 22 // case we'll probably create the buffer from a precreated region of memory. |
25 // ----------------------------------------------------------------------------- | 23 // ----------------------------------------------------------------------------- |
26 class BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice { | 24 class BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice { |
27 public: | 25 public: |
28 // Construct a BitmapPlatformDevice. |is_opaque| should be set if the caller | 26 // Construct a BitmapPlatformDevice. |is_opaque| should be set if the caller |
(...skipping 14 matching lines...) Expand all Loading... |
43 ~BitmapPlatformDevice() override; | 41 ~BitmapPlatformDevice() override; |
44 | 42 |
45 protected: | 43 protected: |
46 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; | 44 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; |
47 | 45 |
48 private: | 46 private: |
49 NativeDrawingContext BeginPlatformPaint(const SkMatrix& transform, | 47 NativeDrawingContext BeginPlatformPaint(const SkMatrix& transform, |
50 const SkIRect& clip_bounds) override; | 48 const SkIRect& clip_bounds) override; |
51 | 49 |
52 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 50 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
53 | |
54 friend class ScopedPlatformPaint; | |
55 }; | 51 }; |
56 | 52 |
57 } // namespace skia | 53 } // namespace skia |
58 | 54 |
59 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_SKIA_H_ | 55 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_SKIA_H_ |
OLD | NEW |