Chromium Code Reviews| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 return SkNEW(BitmapPlatformDeviceFactory); | 146 return SkNEW(BitmapPlatformDeviceFactory); |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool BitmapPlatformDevice::IsVectorial() { | 149 bool BitmapPlatformDevice::IsVectorial() { |
| 150 return false; | 150 return false; |
| 151 } | 151 } |
| 152 | 152 |
| 153 cairo_t* BitmapPlatformDevice::beginPlatformPaint() { | 153 cairo_t* BitmapPlatformDevice::beginPlatformPaint() { |
| 154 data_->LoadConfig(); | 154 data_->LoadConfig(); |
| 155 cairo_t* cairo = data_->bitmap_context(); | 155 cairo_t* cairo = data_->bitmap_context(); |
| 156 // Tell Cairo that we've (probably) modified its pixel buffer without | 156 cairo_surface_t* surface = cairo_get_target(cairo); |
| 157 // its knowledge. | 157 // Tell cairo to flush anything it has pending. |
| 158 cairo_surface_mark_dirty(cairo_get_target(cairo)); | 158 cairo_surface_flush(surface); |
|
Evan Martin
2010/12/14 22:27:11
Doesn't this belong in endPlatformPaint()?
It seem
vandebo (ex-Chrome)
2010/12/14 22:47:53
I read the Docs the other way around. flush needs
| |
| 159 // Tell Cairo that we (probably) modified (actually, will modify) its pixel | |
| 160 // buffer directly. | |
| 161 cairo_surface_mark_dirty(surface); | |
| 159 return cairo; | 162 return cairo; |
| 160 } | 163 } |
| 161 | 164 |
| 162 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, | 165 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, |
| 163 const SkRegion& region) { | 166 const SkRegion& region) { |
| 164 data_->SetMatrixClip(transform, region); | 167 data_->SetMatrixClip(transform, region); |
| 165 } | 168 } |
| 166 | 169 |
| 167 BitmapPlatformDevice& BitmapPlatformDevice::operator=( | 170 BitmapPlatformDevice& BitmapPlatformDevice::operator=( |
| 168 const BitmapPlatformDevice& other) { | 171 const BitmapPlatformDevice& other) { |
| 169 data_ = other.data_; | 172 data_ = other.data_; |
| 170 return *this; | 173 return *this; |
| 171 } | 174 } |
| 172 | 175 |
| 173 } // namespace skia | 176 } // namespace skia |
| OLD | NEW |