Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #define _USE_MATH_DEFINES | 5 #define _USE_MATH_DEFINES |
| 6 #include <algorithm> | 6 #include <algorithm> |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "skia/ext/image_operations.h" | 10 #include "skia/ext/image_operations.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 360 | 360 |
| 361 // static | 361 // static |
| 362 SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source, | 362 SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source, |
| 363 int dest_width, int dest_height, | 363 int dest_width, int dest_height, |
| 364 const SkIRect& dest_subset) { | 364 const SkIRect& dest_subset) { |
| 365 TRACE_EVENT2("skia", "ImageOperations::ResizeSubpixel", | 365 TRACE_EVENT2("skia", "ImageOperations::ResizeSubpixel", |
| 366 "src_pixels", source.width()*source.height(), | 366 "src_pixels", source.width()*source.height(), |
| 367 "dst_pixels", dest_width*dest_height); | 367 "dst_pixels", dest_width*dest_height); |
| 368 // Currently only works on Linux/BSD because these are the only platforms | 368 // Currently only works on Linux/BSD because these are the only platforms |
| 369 // where SkFontHost::GetSubpixelOrder is defined. | 369 // where SkFontHost::GetSubpixelOrder is defined. |
| 370 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 370 #if defined(OS_LINUX) && !defined(GTV) |
|
Nico
2012/07/26 20:57:06
Curious that this wasn't guarded with !GTV before.
| |
| 371 // Understand the display. | 371 // Understand the display. |
| 372 const SkFontHost::LCDOrder order = SkFontHost::GetSubpixelOrder(); | 372 const SkFontHost::LCDOrder order = SkFontHost::GetSubpixelOrder(); |
| 373 const SkFontHost::LCDOrientation orientation = | 373 const SkFontHost::LCDOrientation orientation = |
| 374 SkFontHost::GetSubpixelOrientation(); | 374 SkFontHost::GetSubpixelOrientation(); |
| 375 | 375 |
| 376 // Decide on which dimension, if any, to deploy subpixel rendering. | 376 // Decide on which dimension, if any, to deploy subpixel rendering. |
| 377 int w = 1; | 377 int w = 1; |
| 378 int h = 1; | 378 int h = 1; |
| 379 switch (orientation) { | 379 switch (orientation) { |
| 380 case SkFontHost::kHorizontal_LCDOrientation: | 380 case SkFontHost::kHorizontal_LCDOrientation: |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 539 | 539 |
| 540 // static | 540 // static |
| 541 SkBitmap ImageOperations::Resize(const SkBitmap& source, | 541 SkBitmap ImageOperations::Resize(const SkBitmap& source, |
| 542 ResizeMethod method, | 542 ResizeMethod method, |
| 543 int dest_width, int dest_height) { | 543 int dest_width, int dest_height) { |
| 544 SkIRect dest_subset = { 0, 0, dest_width, dest_height }; | 544 SkIRect dest_subset = { 0, 0, dest_width, dest_height }; |
| 545 return Resize(source, method, dest_width, dest_height, dest_subset); | 545 return Resize(source, method, dest_width, dest_height, dest_subset); |
| 546 } | 546 } |
| 547 | 547 |
| 548 } // namespace skia | 548 } // namespace skia |
| OLD | NEW |