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

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

Issue 10574034: Merge 120640 - [chromium] REGRESSION(r120346) ContentLayerPainter should clear rect to be painted (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 6 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 /* 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 OpaqueRectTrackingContentLayerDelegate::~OpaqueRectTrackingContentLayerDelegate( ) 43 OpaqueRectTrackingContentLayerDelegate::~OpaqueRectTrackingContentLayerDelegate( )
44 { 44 {
45 } 45 }
46 46
47 void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, con st IntRect& clip, IntRect& opaque) 47 void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, con st IntRect& clip, IntRect& opaque)
48 { 48 {
49 PlatformContextSkia platformContext(canvas); 49 PlatformContextSkia platformContext(canvas);
50 platformContext.setTrackOpaqueRegion(!m_opaque); 50 platformContext.setTrackOpaqueRegion(!m_opaque);
51 GraphicsContext context(&platformContext); 51 GraphicsContext context(&platformContext);
52 52
53 context.clearRect(clip);
54 context.clip(clip);
55
56 // Record transform prior to painting, as all opaque tracking will be 53 // Record transform prior to painting, as all opaque tracking will be
57 // relative to this current value. 54 // relative to this current value.
58 AffineTransform canvasToContentTransform = context.getCTM().inverse(); 55 AffineTransform canvasToContentTransform = context.getCTM().inverse();
59 56
60 m_painter->paint(context, clip); 57 m_painter->paint(context, clip);
61 58
62 // Transform tracked opaque paints back to our layer's content space. 59 // Transform tracked opaque paints back to our layer's content space.
63 ASSERT(canvasToContentTransform.isInvertible()); 60 ASSERT(canvasToContentTransform.isInvertible());
64 ASSERT(canvasToContentTransform.preservesAxisAlignment()); 61 ASSERT(canvasToContentTransform.preservesAxisAlignment());
65 FloatRect opaqueCanvasRect = platformContext.opaqueRegion().asRect(); 62 FloatRect opaqueCanvasRect = platformContext.opaqueRegion().asRect();
66 opaque = enclosedIntRect(canvasToContentTransform.mapRect(opaqueCanvasRect)) ; 63 opaque = enclosedIntRect(canvasToContentTransform.mapRect(opaqueCanvasRect)) ;
67 } 64 }
68 65
69 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698