summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authoryosin@chromium.org <yosin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 04:43:12 +0000
committeryosin@chromium.org <yosin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-04 04:43:12 +0000
commit8fd0ed0167cd5d8dba2a8ee74001de63b3915029 (patch)
treed3e1449562ca67852963ce32d31ddc8c09399551 /skia
parentcfe4943802cac9a65767b3597a9d455e6ffa4876 (diff)
downloadchromium_src-8fd0ed0167cd5d8dba2a8ee74001de63b3915029.zip
chromium_src-8fd0ed0167cd5d8dba2a8ee74001de63b3915029.tar.gz
chromium_src-8fd0ed0167cd5d8dba2a8ee74001de63b3915029.tar.bz2
1 Add ScopedGetDC and ScopedSelectObject
* To mark@, sky@ ** base/win/scoped_hdc.h ** base/win/scoped_select_object.h 2 Fix leak in printing * To kmadhusu@ ** Play object creation command in metafile once ** Fix trivial leaks 3 Fix leak in SKIA * To twiz@ ** Fix font leak BUG=98523 TEST=Manual on Win7 Review URL: http://codereview.chromium.org/8084018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/vector_platform_device_emf_win.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/skia/ext/vector_platform_device_emf_win.cc b/skia/ext/vector_platform_device_emf_win.cc
index 9741a83..c754f85 100644
--- a/skia/ext/vector_platform_device_emf_win.cc
+++ b/skia/ext/vector_platform_device_emf_win.cc
@@ -14,7 +14,7 @@
namespace skia {
-//static
+// static
SkDevice* VectorPlatformDeviceEmf::CreateDevice(
int width, int height, bool is_opaque, HANDLE shared_section) {
if (!is_opaque) {
@@ -294,7 +294,7 @@ static bool gdiCanHandleText(const SkPaint& paint) {
}
class SkGDIFontSetup {
-public:
+ public:
SkGDIFontSetup() : fUseGDI(false) {
SkDEBUGCODE(fUseGDIHasBeenCalled = false;)
}
@@ -303,7 +303,7 @@ public:
// can only be called once
bool useGDI(HDC hdc, const SkPaint&);
-private:
+ private:
HDC fHDC;
HFONT fNewFont;
HFONT fSavedFont;
@@ -326,6 +326,7 @@ bool SkGDIFontSetup::useGDI(HDC hdc, const SkPaint& paint) {
lf.lfHeight = -SkScalarRound(paint.getTextSize());
fNewFont = CreateFontIndirect(&lf);
fSavedFont = (HFONT)::SelectObject(hdc, fNewFont);
+ fHDC = hdc;
}
return fUseGDI;
}
@@ -344,8 +345,8 @@ static SkScalar getAscent(const SkPaint& paint) {
return fm.fAscent;
}
-// return the options int for ExtTextOut. Only valid if the paint's text encoding
-// is not UTF8 (in which case ExtTextOut can't be used).
+// return the options int for ExtTextOut. Only valid if the paint's text
+// encoding is not UTF8 (in which case ExtTextOut can't be used).
static UINT getTextOutOptions(const SkPaint& paint) {
if (SkPaint::kGlyphID_TextEncoding == paint.getTextEncoding()) {
return ETO_GLYPH_INDEX;