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

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

Issue 2340813006: accessBitmap is no longer called/needed (Closed)
Patch Set: update unittest Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/debug/gdi_debug_util_win.h" 9 #include "base/debug/gdi_debug_util_win.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 BitmapPlatformDevice::~BitmapPlatformDevice() { 190 BitmapPlatformDevice::~BitmapPlatformDevice() {
191 if (hdc_) 191 if (hdc_)
192 ReleaseBitmapDC(); 192 ReleaseBitmapDC();
193 } 193 }
194 194
195 HDC BitmapPlatformDevice::BeginPlatformPaint(const SkMatrix& transform, 195 HDC BitmapPlatformDevice::BeginPlatformPaint(const SkMatrix& transform,
196 const SkIRect& clip_bounds) { 196 const SkIRect& clip_bounds) {
197 return GetBitmapDC(transform, clip_bounds); 197 return GetBitmapDC(transform, clip_bounds);
198 } 198 }
199 199
200 const SkBitmap& BitmapPlatformDevice::onAccessBitmap() {
201 // FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI
202 // operation has occurred on our DC.
203 if (IsBitmapDCCreated())
204 GdiFlush();
205 return SkBitmapDevice::onAccessBitmap();
206 }
207
208 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo, 200 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo,
209 const SkPaint*) { 201 const SkPaint*) {
210 const SkImageInfo& info = cinfo.fInfo; 202 const SkImageInfo& info = cinfo.fInfo;
211 const bool do_clear = !info.isOpaque(); 203 const bool do_clear = !info.isOpaque();
212 SkASSERT(info.colorType() == kN32_SkColorType); 204 SkASSERT(info.colorType() == kN32_SkColorType);
213 return Create(info.width(), info.height(), info.isOpaque(), NULL, do_clear); 205 return Create(info.width(), info.height(), info.isOpaque(), NULL, do_clear);
214 } 206 }
215 207
216 // PlatformCanvas impl 208 // PlatformCanvas impl
217 209
218 SkCanvas* CreatePlatformCanvas(int width, 210 SkCanvas* CreatePlatformCanvas(int width,
219 int height, 211 int height,
220 bool is_opaque, 212 bool is_opaque,
221 HANDLE shared_section, 213 HANDLE shared_section,
222 OnFailureType failureType) { 214 OnFailureType failureType) {
223 sk_sp<SkBaseDevice> dev( 215 sk_sp<SkBaseDevice> dev(
224 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section)); 216 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section));
225 return CreateCanvas(dev, failureType); 217 return CreateCanvas(dev, failureType);
226 } 218 }
227 219
228 } // namespace skia 220 } // namespace skia
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698