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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2716203002: blink: Fix cc/paint skia type mismatches (Closed)
Patch Set: Fix canvas Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 453
454 // Set WebView background to green with alpha. 454 // Set WebView background to green with alpha.
455 webView->setBaseBackgroundColor(kAlphaGreen); 455 webView->setBaseBackgroundColor(kAlphaGreen);
456 webView->settings()->setShouldClearDocumentBackground(false); 456 webView->settings()->setShouldClearDocumentBackground(false);
457 webView->resize(WebSize(kWidth, kHeight)); 457 webView->resize(WebSize(kWidth, kHeight));
458 webView->updateAllLifecyclePhases(); 458 webView->updateAllLifecyclePhases();
459 459
460 // Set canvas background to red with alpha. 460 // Set canvas background to red with alpha.
461 SkBitmap bitmap; 461 SkBitmap bitmap;
462 bitmap.allocN32Pixels(kWidth, kHeight); 462 bitmap.allocN32Pixels(kWidth, kHeight);
463 SkCanvas bitmapCanvas(bitmap); 463 SkCanvas canvas(bitmap);
464 bitmapCanvas.clear(kAlphaRed); 464 canvas.clear(kAlphaRed);
465
466 PaintCanvasPassThrough canvas(&bitmapCanvas);
467 465
468 PaintRecordBuilder builder(FloatRect(0, 0, kWidth, kHeight)); 466 PaintRecordBuilder builder(FloatRect(0, 0, kWidth, kHeight));
469 467
470 // Paint the root of the main frame in the way that CompositedLayerMapping 468 // Paint the root of the main frame in the way that CompositedLayerMapping
471 // would. 469 // would.
472 FrameView* view = m_webViewHelper.webView()->mainFrameImpl()->frameView(); 470 FrameView* view = m_webViewHelper.webView()->mainFrameImpl()->frameView();
473 PaintLayer* rootLayer = view->layoutViewItem().layer(); 471 PaintLayer* rootLayer = view->layoutViewItem().layer();
474 LayoutRect paintRect(0, 0, kWidth, kHeight); 472 LayoutRect paintRect(0, 0, kWidth, kHeight);
475 PaintLayerPaintingInfo paintingInfo(rootLayer, paintRect, 473 PaintLayerPaintingInfo paintingInfo(rootLayer, paintRect,
476 GlobalPaintNormalPhase, LayoutSize()); 474 GlobalPaintNormalPhase, LayoutSize());
(...skipping 3858 matching lines...) Expand 10 before | Expand all | Expand 10 after
4335 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars()); 4333 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars());
4336 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 4334 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
4337 EXPECT_NE(nullptr, 4335 EXPECT_NE(nullptr,
4338 frameView->layoutViewportScrollableArea()->verticalScrollbar()); 4336 frameView->layoutViewportScrollableArea()->verticalScrollbar());
4339 } else { 4337 } else {
4340 EXPECT_NE(nullptr, frameView->verticalScrollbar()); 4338 EXPECT_NE(nullptr, frameView->verticalScrollbar());
4341 } 4339 }
4342 } 4340 }
4343 4341
4344 } // namespace blink 4342 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698