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

Side by Side Diff: cc/resources/resource_provider.cc

Issue 1380653003: Mac Overlays: Allow SolidColor and Tile quads to be candidates for overlays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@AllOrNothing2
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/resources/resource_provider.h" 5 #include "cc/resources/resource_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/atomic_sequence_num.h" 10 #include "base/atomic_sequence_num.h"
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 #if defined(OS_CHROMEOS) 912 #if defined(OS_CHROMEOS)
913 // TODO(reveman): GL_COMMANDS_ISSUED_CHROMIUM is used for synchronization 913 // TODO(reveman): GL_COMMANDS_ISSUED_CHROMIUM is used for synchronization
914 // on ChromeOS to avoid some performance issues. This only works with 914 // on ChromeOS to avoid some performance issues. This only works with
915 // shared memory backed buffers. crbug.com/436314 915 // shared memory backed buffers. crbug.com/436314
916 DCHECK_EQ(gpu_memory_buffer_->GetHandle().type, gfx::SHARED_MEMORY_BUFFER); 916 DCHECK_EQ(gpu_memory_buffer_->GetHandle().type, gfx::SHARED_MEMORY_BUFFER);
917 #endif 917 #endif
918 918
919 resource_->image_id = gl->CreateImageCHROMIUM( 919 resource_->image_id = gl->CreateImageCHROMIUM(
920 gpu_memory_buffer_->AsClientBuffer(), size_.width(), size_.height(), 920 gpu_memory_buffer_->AsClientBuffer(), size_.width(), size_.height(),
921 GLInternalFormat(resource_->format)); 921 GLInternalFormat(resource_->format));
922 resource_->is_overlay_candidate = true;
922 } 923 }
923 924
924 std::swap(resource_->gpu_memory_buffer, gpu_memory_buffer_); 925 std::swap(resource_->gpu_memory_buffer, gpu_memory_buffer_);
925 resource_->allocated = true; 926 resource_->allocated = true;
926 resource_->dirty_image = true; 927 resource_->dirty_image = true;
927 928
928 // GpuMemoryBuffer provides direct access to the memory used by the GPU. 929 // GpuMemoryBuffer provides direct access to the memory used by the GPU.
929 // Read lock fences are required to ensure that we're not trying to map a 930 // Read lock fences are required to ensure that we're not trying to map a
930 // buffer that is currently in-use by the GPU. 931 // buffer that is currently in-use by the GPU.
931 resource_->read_lock_fences_enabled = true; 932 resource_->read_lock_fences_enabled = true;
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 const int kImportance = 2; 1670 const int kImportance = 2;
1670 pmd->CreateSharedGlobalAllocatorDump(guid); 1671 pmd->CreateSharedGlobalAllocatorDump(guid);
1671 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); 1672 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
1672 } 1673 }
1673 } 1674 }
1674 1675
1675 return true; 1676 return true;
1676 } 1677 }
1677 1678
1678 } // namespace cc 1679 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/overlay_unittest.cc ('k') | content/browser/compositor/browser_compositor_overlay_candidate_validator_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698