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

Side by Side Diff: cc/test/skia_common.h

Issue 15004024: Only use skia::RefPtr for refcounting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment changes, SharePtr Created 7 years, 7 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
« no previous file with comments | « cc/resources/picture_unittest.cc ('k') | cc/test/skia_common.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 2012 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 CC_TEST_SKIA_COMMON_H_
6 #define CC_TEST_SKIA_COMMON_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "skia/ext/lazy_pixel_ref.h"
11 #include "third_party/skia/include/core/SkBitmap.h"
12 #include "third_party/skia/include/core/SkFlattenable.h"
13
14 namespace gfx {
15 class Rect;
16 class Size;
17 }
18
19 namespace cc {
20 class Picture;
21
22 class TestPixelRef : public SkPixelRef {
23 public:
24 TestPixelRef(int width, int height);
25 virtual ~TestPixelRef();
26
27 virtual SkFlattenable::Factory getFactory() OVERRIDE;
28 virtual void* onLockPixels(SkColorTable** color_table) OVERRIDE;
29 virtual void onUnlockPixels() OVERRIDE {}
30 virtual SkPixelRef* deepCopy(
31 SkBitmap::Config config,
32 const SkIRect* subset) OVERRIDE;
33 private:
34 scoped_ptr<char[]> pixels_;
35 };
36
37 class TestLazyPixelRef : public skia::LazyPixelRef {
38 public:
39 TestLazyPixelRef(int width, int height);
40 virtual ~TestLazyPixelRef();
41
42 virtual SkFlattenable::Factory getFactory() OVERRIDE;
43 virtual void* onLockPixels(SkColorTable** color_table) OVERRIDE;
44 virtual void onUnlockPixels() OVERRIDE {}
45 virtual bool PrepareToDecode(const PrepareParams& params) OVERRIDE;
46 virtual SkPixelRef* deepCopy(
47 SkBitmap::Config config,
48 const SkIRect* subset) OVERRIDE;
49 virtual void Decode() OVERRIDE {}
50 private:
51 scoped_ptr<char[]> pixels_;
52 };
53
54 void DrawPicture(unsigned char* buffer,
55 gfx::Rect layer_rect,
56 scoped_refptr<Picture> picture);
57
58 void CreateBitmap(gfx::Size size, const char* uri, SkBitmap* bitmap);
59
60 } // namespace cc
61
62 #endif // CC_TEST_SKIA_COMMON_H_
OLDNEW
« no previous file with comments | « cc/resources/picture_unittest.cc ('k') | cc/test/skia_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698