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

Side by Side Diff: content/shell/browser/webkit_test_controller.cc

Issue 23597036: Convert USE(NATIVE_FULLSCREEN_VIDEO) to a runtime enabled feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@build_hack
Patch Set: CONTENT_EXPORT Created 7 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
« no previous file with comments | « content/public/common/content_switches.cc ('k') | content/shell/renderer/webkit_test_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/shell/browser/webkit_test_controller.h" 5 #include "content/shell/browser/webkit_test_controller.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // image is really expensive. 510 // image is really expensive.
511 if (actual_pixel_hash != expected_pixel_hash_) { 511 if (actual_pixel_hash != expected_pixel_hash_) {
512 std::vector<unsigned char> png; 512 std::vector<unsigned char> png;
513 513
514 // Only the expected PNGs for Mac have a valid alpha channel. 514 // Only the expected PNGs for Mac have a valid alpha channel.
515 #if defined(OS_MACOSX) 515 #if defined(OS_MACOSX)
516 bool discard_transparency = false; 516 bool discard_transparency = false;
517 #else 517 #else
518 bool discard_transparency = true; 518 bool discard_transparency = true;
519 #endif 519 #endif
520 if (CommandLine::ForCurrentProcess()->HasSwitch(
521 switches::kEnableOverlayFullscreenVideo))
522 discard_transparency = false;
520 523
521 std::vector<gfx::PNGCodec::Comment> comments; 524 std::vector<gfx::PNGCodec::Comment> comments;
522 comments.push_back(gfx::PNGCodec::Comment("checksum", actual_pixel_hash)); 525 comments.push_back(gfx::PNGCodec::Comment("checksum", actual_pixel_hash));
523 bool success = gfx::PNGCodec::Encode( 526 bool success = gfx::PNGCodec::Encode(
524 static_cast<const unsigned char*>(image.getPixels()), 527 static_cast<const unsigned char*>(image.getPixels()),
525 gfx::PNGCodec::FORMAT_BGRA, 528 gfx::PNGCodec::FORMAT_BGRA,
526 gfx::Size(image.width(), image.height()), 529 gfx::Size(image.width(), image.height()),
527 static_cast<int>(image.rowBytes()), 530 static_cast<int>(image.rowBytes()),
528 discard_transparency, 531 discard_transparency,
529 comments, 532 comments,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 } 632 }
630 base::MessageLoop::current()->RunUntilIdle(); 633 base::MessageLoop::current()->RunUntilIdle();
631 } 634 }
632 635
633 void WebKitTestController::OnResetDone() { 636 void WebKitTestController::OnResetDone() {
634 base::MessageLoop::current()->PostTask(FROM_HERE, 637 base::MessageLoop::current()->PostTask(FROM_HERE,
635 base::MessageLoop::QuitClosure()); 638 base::MessageLoop::QuitClosure());
636 } 639 }
637 640
638 } // namespace content 641 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | content/shell/renderer/webkit_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698