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

Side by Side Diff: webkit/gpu/webgraphicscontext3d_in_process_impl.cc

Issue 7890046: Command to mark surface inactive, so gpu process can release resources. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Flush only on hide Created 9 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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/gpu/webgraphicscontext3d_in_process_impl.h" 5 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 558
559 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 559 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
560 if (scanline_) { 560 if (scanline_) {
561 delete[] scanline_; 561 delete[] scanline_;
562 scanline_ = 0; 562 scanline_ = 0;
563 } 563 }
564 scanline_ = new unsigned char[width * 4]; 564 scanline_ = new unsigned char[width * 4];
565 #endif // FLIP_FRAMEBUFFER_VERTICALLY 565 #endif // FLIP_FRAMEBUFFER_VERTICALLY
566 } 566 }
567 567
568 void WebGraphicsContext3DInProcessImpl::setVisibility(bool visible) {
569 NOTREACHED();
jonathan.backer 2011/10/07 15:48:37 Probably will be reached on DumpRenderTree.
570 }
571
568 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 572 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
569 void WebGraphicsContext3DInProcessImpl::FlipVertically( 573 void WebGraphicsContext3DInProcessImpl::FlipVertically(
570 unsigned char* framebuffer, unsigned int width, unsigned int height) { 574 unsigned char* framebuffer, unsigned int width, unsigned int height) {
571 unsigned char* scanline = scanline_; 575 unsigned char* scanline = scanline_;
572 if (!scanline) 576 if (!scanline)
573 return; 577 return;
574 unsigned int row_bytes = width * 4; 578 unsigned int row_bytes = width * 4;
575 unsigned int count = height / 2; 579 unsigned int count = height / 2;
576 for (unsigned int i = 0; i < count; i++) { 580 for (unsigned int i = 0; i < count; i++) {
577 unsigned char* row_a = framebuffer + i * row_bytes; 581 unsigned char* row_a = framebuffer + i * row_bytes;
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 if (length > 1) { 1634 if (length > 1) {
1631 entry->translated_source.reset(new char[length]); 1635 entry->translated_source.reset(new char[length]);
1632 ShGetObjectCode(compiler, entry->translated_source.get()); 1636 ShGetObjectCode(compiler, entry->translated_source.get());
1633 } 1637 }
1634 entry->is_valid = true; 1638 entry->is_valid = true;
1635 return true; 1639 return true;
1636 } 1640 }
1637 1641
1638 } // namespace gpu 1642 } // namespace gpu
1639 } // namespace webkit 1643 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698