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

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

Issue 1839113002: Limit manual control of platform painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 // 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_canvas.h"
13 #include "skia/ext/platform_device.h" 14 #include "skia/ext/platform_device.h"
14 15
15 namespace skia { 16 namespace skia {
16 17
17 // ----------------------------------------------------------------------------- 18 // -----------------------------------------------------------------------------
18 // For now we just use SkBitmap for SkBitmapDevice 19 // For now we just use SkBitmap for SkBitmapDevice
19 // 20 //
20 // This is all quite ok for test_shell. In the future we will want to use 21 // This is all quite ok for test_shell. In the future we will want to use
21 // shared memory between the renderer and the main process at least. In this 22 // shared memory between the renderer and the main process at least. In this
22 // case we'll probably create the buffer from a precreated region of memory. 23 // case we'll probably create the buffer from a precreated region of memory.
(...skipping 10 matching lines...) Expand all
33 static BitmapPlatformDevice* Create(int width, int height, bool is_opaque, 34 static BitmapPlatformDevice* Create(int width, int height, bool is_opaque,
34 uint8_t* data); 35 uint8_t* data);
35 36
36 // Create a BitmapPlatformDevice from an already constructed bitmap; 37 // Create a BitmapPlatformDevice from an already constructed bitmap;
37 // you should probably be using Create(). This may become private later if 38 // you should probably be using Create(). This may become private later if
38 // we ever have to share state between some native drawing UI and Skia, like 39 // we ever have to share state between some native drawing UI and Skia, like
39 // the Windows and Mac versions of this class do. 40 // the Windows and Mac versions of this class do.
40 explicit BitmapPlatformDevice(const SkBitmap& other); 41 explicit BitmapPlatformDevice(const SkBitmap& other);
41 ~BitmapPlatformDevice() override; 42 ~BitmapPlatformDevice() override;
42 43
44 protected:
43 PlatformSurface BeginPlatformPaint() override; 45 PlatformSurface BeginPlatformPaint() override;
44 46
45 protected:
46 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; 47 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override;
47 48
48 private: 49 private:
49 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); 50 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice);
51
52 friend class skia::ScopedPlatformPaint;
50 }; 53 };
51 54
52 } // namespace skia 55 } // namespace skia
53 56
54 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_SKIA_H_ 57 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_SKIA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698