| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef SKIA_EXT_PLATFORM_DEVICE_MAC_H_ | 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_MAC_H_ |
| 6 #define SKIA_EXT_PLATFORM_DEVICE_MAC_H_ | 6 #define SKIA_EXT_PLATFORM_DEVICE_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <ApplicationServices/ApplicationServices.h> | 9 #import <ApplicationServices/ApplicationServices.h> |
| 10 #include "third_party/skia/include/core/SkDevice.h" | 10 #include "third_party/skia/include/core/SkDevice.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const SkRegion& region, | 53 const SkRegion& region, |
| 54 const SkMatrix& transformation); | 54 const SkMatrix& transformation); |
| 55 | 55 |
| 56 protected: | 56 protected: |
| 57 // Forwards |bitmap| to SkDevice's constructor. | 57 // Forwards |bitmap| to SkDevice's constructor. |
| 58 PlatformDevice(const SkBitmap& bitmap); | 58 PlatformDevice(const SkBitmap& bitmap); |
| 59 | 59 |
| 60 // Loads the specified Skia transform into the device context | 60 // Loads the specified Skia transform into the device context |
| 61 static void LoadTransformToCGContext(CGContextRef context, | 61 static void LoadTransformToCGContext(CGContextRef context, |
| 62 const SkMatrix& matrix); | 62 const SkMatrix& matrix); |
| 63 | |
| 64 // Function pointer used by the processPixels method for setting the alpha | |
| 65 // value of a particular pixel. | |
| 66 typedef void (*adjustAlpha)(uint32_t* pixel); | |
| 67 | |
| 68 // Loops through each of the pixels in the specified range, invoking | |
| 69 // adjustor for the alpha value of each pixel. | |
| 70 virtual void processPixels(int x, | |
| 71 int y, | |
| 72 int width, | |
| 73 int height, | |
| 74 adjustAlpha adjustor) = 0; | |
| 75 }; | 63 }; |
| 76 | 64 |
| 77 } // namespace skia | 65 } // namespace skia |
| 78 | 66 |
| 79 #endif // SKIA_EXT_PLATFORM_DEVICE_MAC_H_ | 67 #endif // SKIA_EXT_PLATFORM_DEVICE_MAC_H_ |
| 80 | 68 |
| OLD | NEW |