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

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

Issue 558083002: [cc] Add nearest neighbor filtering for TextureLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to WebExternalTextureLayer::setNearestNeighbor. Created 6 years, 1 month 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/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 DCHECK(thread_checker_.CalledOnValidThread()); 589 DCHECK(thread_checker_.CalledOnValidThread());
590 // Just store the information. Mailbox will be consumed in LockForRead(). 590 // Just store the information. Mailbox will be consumed in LockForRead().
591 ResourceId id = next_id_++; 591 ResourceId id = next_id_++;
592 DCHECK(mailbox.IsValid()); 592 DCHECK(mailbox.IsValid());
593 Resource& resource = resources_[id]; 593 Resource& resource = resources_[id];
594 if (mailbox.IsTexture()) { 594 if (mailbox.IsTexture()) {
595 resource = Resource(0, 595 resource = Resource(0,
596 gfx::Size(), 596 gfx::Size(),
597 Resource::External, 597 Resource::External,
598 mailbox.target(), 598 mailbox.target(),
599 GL_LINEAR, 599 mailbox.nearest_neighbor() ? GL_NEAREST : GL_LINEAR,
600 0, 600 0,
601 GL_CLAMP_TO_EDGE, 601 GL_CLAMP_TO_EDGE,
602 TextureHintImmutable, 602 TextureHintImmutable,
603 RGBA_8888); 603 RGBA_8888);
604 } else { 604 } else {
605 DCHECK(mailbox.IsSharedMemory()); 605 DCHECK(mailbox.IsSharedMemory());
606 base::SharedMemory* shared_memory = mailbox.shared_memory(); 606 base::SharedMemory* shared_memory = mailbox.shared_memory();
607 DCHECK(shared_memory->memory()); 607 DCHECK(shared_memory->memory());
608 uint8_t* pixels = reinterpret_cast<uint8_t*>(shared_memory->memory()); 608 uint8_t* pixels = reinterpret_cast<uint8_t*>(shared_memory->memory());
609 DCHECK(pixels); 609 DCHECK(pixels);
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2064 ContextProvider* context_provider = output_surface_->context_provider(); 2064 ContextProvider* context_provider = output_surface_->context_provider();
2065 return context_provider ? context_provider->ContextGL() : NULL; 2065 return context_provider ? context_provider->ContextGL() : NULL;
2066 } 2066 }
2067 2067
2068 class GrContext* ResourceProvider::GrContext() const { 2068 class GrContext* ResourceProvider::GrContext() const {
2069 ContextProvider* context_provider = output_surface_->context_provider(); 2069 ContextProvider* context_provider = output_surface_->context_provider();
2070 return context_provider ? context_provider->GrContext() : NULL; 2070 return context_provider ? context_provider->GrContext() : NULL;
2071 } 2071 }
2072 2072
2073 } // namespace cc 2073 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698