| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "skia/ext/bitmap_platform_device_linux.h" | 5 #include "skia/ext/bitmap_platform_device_linux.h" |
| 6 | 6 |
| 7 #include "skia/ext/bitmap_platform_device_data.h" | 7 #include "skia/ext/bitmap_platform_device_data.h" |
| 8 | 8 |
| 9 #include <cairo/cairo.h> | 9 #include <cairo/cairo.h> |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 BitmapPlatformDevice::BitmapPlatformDevice( | 135 BitmapPlatformDevice::BitmapPlatformDevice( |
| 136 const BitmapPlatformDevice& other) | 136 const BitmapPlatformDevice& other) |
| 137 : PlatformDevice(const_cast<BitmapPlatformDevice&>( | 137 : PlatformDevice(const_cast<BitmapPlatformDevice&>( |
| 138 other).accessBitmap(true)), | 138 other).accessBitmap(true)), |
| 139 data_(other.data_) { | 139 data_(other.data_) { |
| 140 } | 140 } |
| 141 | 141 |
| 142 BitmapPlatformDevice::~BitmapPlatformDevice() { | 142 BitmapPlatformDevice::~BitmapPlatformDevice() { |
| 143 } | 143 } |
| 144 | 144 |
| 145 SkDeviceFactory* BitmapPlatformDevice::getDeviceFactory() { |
| 146 return SkNEW(BitmapPlatformDeviceFactory); |
| 147 } |
| 148 |
| 149 bool BitmapPlatformDevice::IsVectorial() { |
| 150 return false; |
| 151 } |
| 152 |
| 145 cairo_t* BitmapPlatformDevice::beginPlatformPaint() { | 153 cairo_t* BitmapPlatformDevice::beginPlatformPaint() { |
| 146 data_->LoadConfig(); | 154 data_->LoadConfig(); |
| 147 cairo_t* cairo = data_->bitmap_context(); | 155 cairo_t* cairo = data_->bitmap_context(); |
| 148 // Tell Cairo that we've (probably) modified its pixel buffer without | 156 // Tell Cairo that we've (probably) modified its pixel buffer without |
| 149 // its knowledge. | 157 // its knowledge. |
| 150 cairo_surface_mark_dirty(cairo_get_target(cairo)); | 158 cairo_surface_mark_dirty(cairo_get_target(cairo)); |
| 151 return cairo; | 159 return cairo; |
| 152 } | 160 } |
| 153 | 161 |
| 154 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, | 162 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, |
| 155 const SkRegion& region) { | 163 const SkRegion& region) { |
| 156 data_->SetMatrixClip(transform, region); | 164 data_->SetMatrixClip(transform, region); |
| 157 } | 165 } |
| 158 | 166 |
| 159 BitmapPlatformDevice& BitmapPlatformDevice::operator=( | 167 BitmapPlatformDevice& BitmapPlatformDevice::operator=( |
| 160 const BitmapPlatformDevice& other) { | 168 const BitmapPlatformDevice& other) { |
| 161 data_ = other.data_; | 169 data_ = other.data_; |
| 162 return *this; | 170 return *this; |
| 163 } | 171 } |
| 164 | 172 |
| 165 } // namespace skia | 173 } // namespace skia |
| OLD | NEW |