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

Side by Side Diff: Source/web/WebLocalFrameImpl.cpp

Issue 671813002: Use the stateless GC::fillRect variant when possible. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: minor LayerPainter update Created 6 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 frame()->view()->updateLayoutAndStyleForPainting(); 338 frame()->view()->updateLayoutAndStyleForPainting();
339 339
340 float pageHeight; 340 float pageHeight;
341 computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1, pageHeight); 341 computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1, pageHeight);
342 342
343 const float pageWidth = pageSizeInPixels.width(); 343 const float pageWidth = pageSizeInPixels.width();
344 size_t numPages = pageRects().size(); 344 size_t numPages = pageRects().size();
345 int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1; 345 int totalHeight = numPages * (pageSizeInPixels.height() + 1) - 1;
346 346
347 // Fill the whole background by white. 347 // Fill the whole background by white.
348 graphicsContext.setFillColor(Color::white); 348 graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight), Color: :white);
349 graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight));
350 349
351 int currentHeight = 0; 350 int currentHeight = 0;
352 for (size_t pageIndex = 0; pageIndex < numPages; pageIndex++) { 351 for (size_t pageIndex = 0; pageIndex < numPages; pageIndex++) {
353 // Draw a line for a page boundary if this isn't the first page. 352 // Draw a line for a page boundary if this isn't the first page.
354 if (pageIndex > 0) { 353 if (pageIndex > 0) {
355 graphicsContext.save(); 354 graphicsContext.save();
356 graphicsContext.setStrokeColor(Color(0, 0, 255)); 355 graphicsContext.setStrokeColor(Color(0, 0, 255));
357 graphicsContext.setFillColor(Color(0, 0, 255)); 356 graphicsContext.setFillColor(Color(0, 0, 255));
358 graphicsContext.drawLine(IntPoint(0, currentHeight), IntPoint(pa geWidth, currentHeight)); 357 graphicsContext.drawLine(IntPoint(0, currentHeight), IntPoint(pa geWidth, currentHeight));
359 graphicsContext.restore(); 358 graphicsContext.restore();
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 1928
1930 void WebLocalFrameImpl::invalidateAll() const 1929 void WebLocalFrameImpl::invalidateAll() const
1931 { 1930 {
1932 ASSERT(frame() && frame()->view()); 1931 ASSERT(frame() && frame()->view());
1933 FrameView* view = frame()->view(); 1932 FrameView* view = frame()->view();
1934 view->invalidateRect(view->frameRect()); 1933 view->invalidateRect(view->frameRect());
1935 invalidateScrollbar(); 1934 invalidateScrollbar();
1936 } 1935 }
1937 1936
1938 } // namespace blink 1937 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698