Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: skia/ext/bitmap_platform_device_win.cc

Issue 75020: Make non-rectangular clip region apply in the correct location.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | skia/ext/platform_canvas_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "skia/ext/bitmap_platform_device_win.h" 5 #include "skia/ext/bitmap_platform_device_win.h"
6 6
7 #include "SkMatrix.h" 7 #include "SkMatrix.h"
8 #include "SkRefCnt.h" 8 #include "SkRefCnt.h"
9 #include "SkRegion.h" 9 #include "SkRegion.h"
10 #include "SkUtils.h" 10 #include "SkUtils.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 153
154 void BitmapPlatformDeviceWin::BitmapPlatformDeviceWinData::LoadConfig() { 154 void BitmapPlatformDeviceWin::BitmapPlatformDeviceWinData::LoadConfig() {
155 if (!config_dirty_ || !hdc_) 155 if (!config_dirty_ || !hdc_)
156 return; // Nothing to do. 156 return; // Nothing to do.
157 config_dirty_ = false; 157 config_dirty_ = false;
158 158
159 // Transform. 159 // Transform.
160 SkMatrix t(transform_); 160 SkMatrix t(transform_);
161 LoadTransformToDC(hdc_, t); 161 LoadTransformToDC(hdc_, t);
162 // We don't use transform_ for the clipping region since the translation is
163 // already applied to offset_x_ and offset_y_.
164 t.reset();
165 LoadClippingRegionToDC(hdc_, clip_region_, t); 162 LoadClippingRegionToDC(hdc_, clip_region_, t);
166 } 163 }
167 164
168 // We use this static factory function instead of the regular constructor so 165 // We use this static factory function instead of the regular constructor so
169 // that we can create the pixel data before calling the constructor. This is 166 // that we can create the pixel data before calling the constructor. This is
170 // required so that we can call the base class' constructor with the pixel 167 // required so that we can call the base class' constructor with the pixel
171 // data. 168 // data.
172 BitmapPlatformDeviceWin* BitmapPlatformDeviceWin::create( 169 BitmapPlatformDeviceWin* BitmapPlatformDeviceWin::create(
173 HDC screen_dc, 170 HDC screen_dc,
174 int width, 171 int width,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 362
366 void BitmapPlatformDeviceWin::onAccessBitmap(SkBitmap* bitmap) { 363 void BitmapPlatformDeviceWin::onAccessBitmap(SkBitmap* bitmap) {
367 // FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI 364 // FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI
368 // operation has occurred on our DC. 365 // operation has occurred on our DC.
369 if (data_->IsBitmapDCCreated()) 366 if (data_->IsBitmapDCCreated())
370 GdiFlush(); 367 GdiFlush();
371 } 368 }
372 369
373 } // namespace skia 370 } // namespace skia
374 371
OLDNEW
« no previous file with comments | « no previous file | skia/ext/platform_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698