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

Side by Side Diff: webkit/tools/test_shell/mac/webwidget_host.mm

Issue 2824038: WebKit implementation of <meter> element assumes underlying ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 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 | « 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 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008-2009 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "webkit/tools/test_shell/webwidget_host.h" 7 #include "webkit/tools/test_shell/webwidget_host.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "gfx/rect.h" 10 #include "gfx/rect.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 paint_rect_ = client_rect; 167 paint_rect_ = client_rect;
168 canvas_.reset(new skia::PlatformCanvas( 168 canvas_.reset(new skia::PlatformCanvas(
169 paint_rect_.width(), paint_rect_.height(), true)); 169 paint_rect_.width(), paint_rect_.height(), true));
170 } 170 }
171 171
172 // make sure webkit draws into our bitmap, not the window 172 // make sure webkit draws into our bitmap, not the window
173 CGContextRef bitmap_context = 173 CGContextRef bitmap_context =
174 canvas_->getTopPlatformDevice().GetBitmapContext(); 174 canvas_->getTopPlatformDevice().GetBitmapContext();
175 [NSGraphicsContext setCurrentContext: 175 [NSGraphicsContext setCurrentContext:
176 [NSGraphicsContext graphicsContextWithGraphicsPort:bitmap_context 176 [NSGraphicsContext graphicsContextWithGraphicsPort:bitmap_context
177 flipped:NO]]; 177 flipped:YES]];
178 178
179 // This may result in more invalidation 179 // This may result in more invalidation
180 webwidget_->layout(); 180 webwidget_->layout();
181 181
182 // Scroll the canvas if necessary 182 // Scroll the canvas if necessary
183 scroll_rect_ = client_rect.Intersect(scroll_rect_); 183 scroll_rect_ = client_rect.Intersect(scroll_rect_);
184 if (!scroll_rect_.IsEmpty()) { 184 if (!scroll_rect_.IsEmpty()) {
185 // add to invalidate rect, since there's no equivalent of ScrollDC. 185 // add to invalidate rect, since there's no equivalent of ScrollDC.
186 paint_rect_ = paint_rect_.Union(scroll_rect_); 186 paint_rect_ = paint_rect_.Union(scroll_rect_);
187 } 187 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { 268 void WebWidgetHost::PaintRect(const gfx::Rect& rect) {
269 #ifndef NDEBUG 269 #ifndef NDEBUG
270 DCHECK(!painting_); 270 DCHECK(!painting_);
271 #endif 271 #endif
272 DCHECK(canvas_.get()); 272 DCHECK(canvas_.get());
273 273
274 set_painting(true); 274 set_painting(true);
275 webwidget_->paint(webkit_glue::ToWebCanvas(canvas_.get()), rect); 275 webwidget_->paint(webkit_glue::ToWebCanvas(canvas_.get()), rect);
276 set_painting(false); 276 set_painting(false);
277 } 277 }
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