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

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

Issue 7754001: Revert 98230 - CL removing inheritance of SkDevice from PlatformDevice. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « skia/ext/bitmap_platform_device_win.h ('k') | skia/ext/platform_device.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <windows.h> 5 #include <windows.h>
6 #include <psapi.h> 6 #include <psapi.h>
7 7
8 #include "skia/ext/bitmap_platform_device_win.h" 8 #include "skia/ext/bitmap_platform_device_win.h"
9 9
10 #include "skia/ext/bitmap_platform_device_data.h" 10 #include "skia/ext/bitmap_platform_device_data.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 screen_dc, width, height, is_opaque, shared_section); 158 screen_dc, width, height, is_opaque, shared_section);
159 ReleaseDC(NULL, screen_dc); 159 ReleaseDC(NULL, screen_dc);
160 return device; 160 return device;
161 } 161 }
162 162
163 // The device will own the HBITMAP, which corresponds to also owning the pixel 163 // The device will own the HBITMAP, which corresponds to also owning the pixel
164 // data. Therefore, we do not transfer ownership to the SkDevice's bitmap. 164 // data. Therefore, we do not transfer ownership to the SkDevice's bitmap.
165 BitmapPlatformDevice::BitmapPlatformDevice( 165 BitmapPlatformDevice::BitmapPlatformDevice(
166 BitmapPlatformDeviceData* data, 166 BitmapPlatformDeviceData* data,
167 const SkBitmap& bitmap) 167 const SkBitmap& bitmap)
168 : SkDevice(bitmap), 168 : PlatformDevice(bitmap),
169 data_(data) { 169 data_(data) {
170 // The data object is already ref'ed for us by create(). 170 // The data object is already ref'ed for us by create().
171 SkDEBUGCODE(begin_paint_count_ = 0); 171 SkDEBUGCODE(begin_paint_count_ = 0);
172 SetPlatformDevice(this, this);
173 } 172 }
174 173
175 BitmapPlatformDevice::~BitmapPlatformDevice() { 174 BitmapPlatformDevice::~BitmapPlatformDevice() {
176 SkASSERT(begin_paint_count_ == 0); 175 SkASSERT(begin_paint_count_ == 0);
177 data_->unref(); 176 data_->unref();
178 } 177 }
179 178
180 HDC BitmapPlatformDevice::BeginPlatformPaint() { 179 HDC BitmapPlatformDevice::BeginPlatformPaint() {
181 SkDEBUGCODE(begin_paint_count_++); 180 SkDEBUGCODE(begin_paint_count_++);
182 return data_->GetBitmapDC(); 181 return data_->GetBitmapDC();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } 255 }
257 256
258 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice( 257 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice(
259 SkBitmap::Config config, int width, int height, bool isOpaque, 258 SkBitmap::Config config, int width, int height, bool isOpaque,
260 Usage /*usage*/) { 259 Usage /*usage*/) {
261 SkASSERT(config == SkBitmap::kARGB_8888_Config); 260 SkASSERT(config == SkBitmap::kARGB_8888_Config);
262 return BitmapPlatformDevice::create(width, height, isOpaque, NULL); 261 return BitmapPlatformDevice::create(width, height, isOpaque, NULL);
263 } 262 }
264 263
265 } // namespace skia 264 } // namespace skia
265
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_win.h ('k') | skia/ext/platform_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698