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

Side by Side Diff: media/filters/skcanvas_video_renderer_unittest.cc

Issue 16297002: Update media/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | « media/filters/pipeline_integration_test_base.cc ('k') | media/filters/video_frame_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "media/base/video_frame.h" 5 #include "media/base/video_frame.h"
6 #include "media/base/video_util.h" 6 #include "media/base/video_util.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "third_party/skia/include/core/SkCanvas.h" 8 #include "third_party/skia/include/core/SkCanvas.h"
9 #include "third_party/skia/include/core/SkDevice.h" 9 #include "third_party/skia/include/core/SkDevice.h"
10 #include "media/filters/skcanvas_video_renderer.h" 10 #include "media/filters/skcanvas_video_renderer.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 virtual ~SkCanvasVideoRendererTest(); 51 virtual ~SkCanvasVideoRendererTest();
52 52
53 // Paints to |canvas| using |renderer_| without any frame data. 53 // Paints to |canvas| using |renderer_| without any frame data.
54 void PaintWithoutFrame(SkCanvas* canvas); 54 void PaintWithoutFrame(SkCanvas* canvas);
55 55
56 // Paints the |video_frame| to the |canvas| using |renderer_|, setting the 56 // Paints the |video_frame| to the |canvas| using |renderer_|, setting the
57 // color of |video_frame| to |color| first. 57 // color of |video_frame| to |color| first.
58 void Paint(VideoFrame* video_frame, SkCanvas* canvas, Color color); 58 void Paint(VideoFrame* video_frame, SkCanvas* canvas, Color color);
59 59
60 // Getters for various frame sizes. 60 // Getters for various frame sizes.
61 VideoFrame* natural_frame() { return natural_frame_; } 61 VideoFrame* natural_frame() { return natural_frame_.get(); }
62 VideoFrame* larger_frame() { return larger_frame_; } 62 VideoFrame* larger_frame() { return larger_frame_.get(); }
63 VideoFrame* smaller_frame() { return smaller_frame_; } 63 VideoFrame* smaller_frame() { return smaller_frame_.get(); }
64 VideoFrame* cropped_frame() { return cropped_frame_; } 64 VideoFrame* cropped_frame() { return cropped_frame_.get(); }
65 65
66 // Getters for canvases that trigger the various painting paths. 66 // Getters for canvases that trigger the various painting paths.
67 SkCanvas* fast_path_canvas() { return &fast_path_canvas_; } 67 SkCanvas* fast_path_canvas() { return &fast_path_canvas_; }
68 SkCanvas* slow_path_canvas() { return &slow_path_canvas_; } 68 SkCanvas* slow_path_canvas() { return &slow_path_canvas_; }
69 69
70 private: 70 private:
71 SkCanvasVideoRenderer renderer_; 71 SkCanvasVideoRenderer renderer_;
72 72
73 scoped_refptr<VideoFrame> natural_frame_; 73 scoped_refptr<VideoFrame> natural_frame_;
74 scoped_refptr<VideoFrame> larger_frame_; 74 scoped_refptr<VideoFrame> larger_frame_;
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 kHeight * 1 / 6 - 1)); 339 kHeight * 1 / 6 - 1));
340 EXPECT_EQ(SK_ColorRED, GetColorAt(slow_path_canvas(), kWidth * 3 / 8, 340 EXPECT_EQ(SK_ColorRED, GetColorAt(slow_path_canvas(), kWidth * 3 / 8,
341 kHeight * 1 / 6 - 1)); 341 kHeight * 1 / 6 - 1));
342 EXPECT_EQ(SK_ColorGREEN, GetColorAt(slow_path_canvas(), kWidth * 1 / 8 - 1, 342 EXPECT_EQ(SK_ColorGREEN, GetColorAt(slow_path_canvas(), kWidth * 1 / 8 - 1,
343 kHeight * 3 / 6)); 343 kHeight * 3 / 6));
344 EXPECT_EQ(SK_ColorBLUE, GetColorAt(slow_path_canvas(), kWidth * 3 / 8, 344 EXPECT_EQ(SK_ColorBLUE, GetColorAt(slow_path_canvas(), kWidth * 3 / 8,
345 kHeight * 3 / 6)); 345 kHeight * 3 / 6));
346 } 346 }
347 347
348 } // namespace media 348 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/pipeline_integration_test_base.cc ('k') | media/filters/video_frame_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698