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

Side by Side Diff: Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp

Issue 12425009: Merge 144688 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 9 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, con st WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque) 52 void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, con st WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque)
53 { 53 {
54 PlatformContextSkia platformContext(canvas); 54 PlatformContextSkia platformContext(canvas);
55 #if defined(SK_SUPPORT_HINTING_SCALE_FACTOR) 55 #if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
56 if (canvas) 56 if (canvas)
57 platformContext.setHintingScaleFactor(canvas->getTotalMatrix().getScaleX ()); 57 platformContext.setHintingScaleFactor(canvas->getTotalMatrix().getScaleX ());
58 #endif 58 #endif
59 platformContext.setTrackOpaqueRegion(!m_opaque); 59 platformContext.setTrackOpaqueRegion(!m_opaque);
60 platformContext.setDrawingToImageBuffer(!m_opaque);
60 GraphicsContext context(&platformContext); 61 GraphicsContext context(&platformContext);
61 context.setShouldSmoothFonts(canPaintLCDText && m_opaque); 62 context.setShouldSmoothFonts(canPaintLCDText && m_opaque);
62 63
63 // Record transform prior to painting, as all opaque tracking will be 64 // Record transform prior to painting, as all opaque tracking will be
64 // relative to this current value. 65 // relative to this current value.
65 AffineTransform canvasToContentTransform = context.getCTM().inverse(); 66 AffineTransform canvasToContentTransform = context.getCTM().inverse();
66 67
67 m_painter->paint(context, clip); 68 m_painter->paint(context, clip);
68 69
69 // Transform tracked opaque paints back to our layer's content space. 70 // Transform tracked opaque paints back to our layer's content space.
70 ASSERT(canvasToContentTransform.isInvertible()); 71 ASSERT(canvasToContentTransform.isInvertible());
71 ASSERT(canvasToContentTransform.preservesAxisAlignment()); 72 ASSERT(canvasToContentTransform.preservesAxisAlignment());
72 opaque = canvasToContentTransform.mapRect(platformContext.opaqueRegion().asR ect()); 73 opaque = canvasToContentTransform.mapRect(platformContext.opaqueRegion().asR ect());
73 } 74 }
74 75
75 } 76 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698