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

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

Issue 22796028: Updating Chromium to Skia SkBaseDevice/SkBitmapDevice split (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODOs Created 7 years, 3 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 (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/filters/skcanvas_video_renderer.h" 5 #include "media/filters/skcanvas_video_renderer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/video_frame.h" 8 #include "media/base/video_frame.h"
9 #include "media/base/yuv_convert.h" 9 #include "media/base/yuv_convert.h"
10 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 const SkMatrix& total_matrix = canvas->getTotalMatrix(); 50 const SkMatrix& total_matrix = canvas->getTotalMatrix();
51 // Perform the following checks here: 51 // Perform the following checks here:
52 // 1. Check for skewing factors of the transformation matrix. They should be 52 // 1. Check for skewing factors of the transformation matrix. They should be
53 // zero. 53 // zero.
54 // 2. Check for mirroring and flipping. Make sure they are greater than zero. 54 // 2. Check for mirroring and flipping. Make sure they are greater than zero.
55 if (SkScalarNearlyZero(total_matrix.getSkewX()) && 55 if (SkScalarNearlyZero(total_matrix.getSkewX()) &&
56 SkScalarNearlyZero(total_matrix.getSkewY()) && 56 SkScalarNearlyZero(total_matrix.getSkewY()) &&
57 total_matrix.getScaleX() > 0 && 57 total_matrix.getScaleX() > 0 &&
58 total_matrix.getScaleY() > 0) { 58 total_matrix.getScaleY() > 0) {
59 SkDevice* device = canvas->getDevice(); 59 SkBaseDevice* device = canvas->getDevice();
60 const SkBitmap::Config config = device->config(); 60 const SkBitmap::Config config = device->config();
61 61
62 if (config == SkBitmap::kARGB_8888_Config && device->isOpaque()) { 62 if (config == SkBitmap::kARGB_8888_Config && device->isOpaque()) {
63 return true; 63 return true;
64 } 64 }
65 } 65 }
66 66
67 return false; 67 return false;
68 } 68 }
69 69
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 ConvertVideoFrameToBitmap(video_frame, &last_frame_); 315 ConvertVideoFrameToBitmap(video_frame, &last_frame_);
316 last_frame_timestamp_ = video_frame->GetTimestamp(); 316 last_frame_timestamp_ = video_frame->GetTimestamp();
317 } 317 }
318 318
319 // Do a slower paint using |last_frame_|. 319 // Do a slower paint using |last_frame_|.
320 paint.setFilterBitmap(true); 320 paint.setFilterBitmap(true);
321 canvas->drawBitmapRect(last_frame_, NULL, dest, &paint); 321 canvas->drawBitmapRect(last_frame_, NULL, dest, &paint);
322 } 322 }
323 323
324 } // namespace media 324 } // namespace media
OLDNEW
« no previous file with comments | « content/shell/renderer/webkit_test_runner.cc ('k') | media/filters/skcanvas_video_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698