| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "content/browser/renderer_host/compositing_iosurface_transformer_mac.h" | 5 #include "content/browser/renderer_host/compositing_iosurface_transformer_mac.h" |
| 6 | 6 |
| 7 #include <OpenGL/CGLCurrent.h> | 7 #include <OpenGL/CGLCurrent.h> |
| 8 #include <OpenGL/CGLRenderers.h> | 8 #include <OpenGL/CGLRenderers.h> |
| 9 #include <OpenGL/CGLTypes.h> | 9 #include <OpenGL/CGLTypes.h> |
| 10 #include <OpenGL/OpenGL.h> | 10 #include <OpenGL/OpenGL.h> |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 | 188 |
| 189 SkBitmap result; | 189 SkBitmap result; |
| 190 result.setConfig(cropped_src.config(), to_size.width(), to_size.height()); | 190 result.setConfig(cropped_src.config(), to_size.width(), to_size.height()); |
| 191 CHECK(result.allocPixels()); | 191 CHECK(result.allocPixels()); |
| 192 | 192 |
| 193 SkCanvas canvas(result); | 193 SkCanvas canvas(result); |
| 194 canvas.scale(static_cast<double>(result.width()) / cropped_src.width(), | 194 canvas.scale(static_cast<double>(result.width()) / cropped_src.width(), |
| 195 static_cast<double>(result.height()) / cropped_src.height()); | 195 static_cast<double>(result.height()) / cropped_src.height()); |
| 196 SkPaint paint; | 196 SkPaint paint; |
| 197 paint.setFilterBitmap(true); // Use bilinear filtering. | 197 paint.setFilterLevel(SkPaint::kLow_FilterLevel); // Use bilinear filtering. |
| 198 canvas.drawBitmap(cropped_src, 0, 0, &paint); | 198 canvas.drawBitmap(cropped_src, 0, 0, &paint); |
| 199 | 199 |
| 200 return result; | 200 return result; |
| 201 } | 201 } |
| 202 | 202 |
| 203 // The maximum value by which a pixel value may deviate from the expected value | 203 // The maximum value by which a pixel value may deviate from the expected value |
| 204 // before considering it "significantly different." This is meant to account | 204 // before considering it "significantly different." This is meant to account |
| 205 // for the slight differences in filtering techniques used between the various | 205 // for the slight differences in filtering techniques used between the various |
| 206 // GPUs and software implementations. | 206 // GPUs and software implementations. |
| 207 const int kDifferenceThreshold = 16; | 207 const int kDifferenceThreshold = 16; |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 // Subrect resize test: missing top row, and left+right columns in source. | 524 // Subrect resize test: missing top row, and left+right columns in source. |
| 525 RunTransformRGBToYV12Test( | 525 RunTransformRGBToYV12Test( |
| 526 src_bitmap, | 526 src_bitmap, |
| 527 gfx::Rect(1, 1, params.src_width - 2, params.src_height - 1), | 527 gfx::Rect(1, 1, params.src_width - 2, params.src_height - 1), |
| 528 dst_size); | 528 dst_size); |
| 529 } | 529 } |
| 530 } | 530 } |
| 531 } | 531 } |
| 532 | 532 |
| 533 } // namespace content | 533 } // namespace content |
| OLD | NEW |