Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/aura/gpu_process_transport_factory.h" | 5 #include "content/browser/aura/gpu_process_transport_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 virtual unsigned int PrepareTexture() OVERRIDE { | 66 virtual unsigned int PrepareTexture() OVERRIDE { |
| 67 return texture_id_; | 67 return texture_id_; |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual WebKit::WebGraphicsContext3D* HostContext3D() OVERRIDE { | 70 virtual WebKit::WebGraphicsContext3D* HostContext3D() OVERRIDE { |
| 71 return host_context_; | 71 return host_context_; |
| 72 } | 72 } |
| 73 | 73 |
| 74 // ImageTransportFactory overrides: | 74 // ImageTransportFactory overrides: |
| 75 virtual void OnLostResources() OVERRIDE { | 75 virtual void OnLostResources() OVERRIDE { |
| 76 DeleteTexture(); | 76 DeleteTexture(); |
|
cpu_(ooo_6.6-7.5)
2013/08/21 22:50:09
I think we should not call DeleteTexture() here an
piman
2013/08/21 23:01:33
I disagree. It can cause leaks depending on the GL
| |
| 77 host_context_ = NULL; | |
| 77 } | 78 } |
| 78 | 79 |
| 79 protected: | 80 protected: |
| 80 virtual ~OwnedTexture() { | 81 virtual ~OwnedTexture() { |
| 81 ImageTransportFactory::GetInstance()->RemoveObserver(this); | 82 ImageTransportFactory::GetInstance()->RemoveObserver(this); |
| 82 DeleteTexture(); | 83 DeleteTexture(); |
| 83 } | 84 } |
| 84 | 85 |
| 85 protected: | 86 protected: |
| 86 void DeleteTexture() { | 87 void DeleteTexture() { |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 501 shared_contexts_main_thread_ = NULL; | 502 shared_contexts_main_thread_ = NULL; |
| 502 | 503 |
| 503 scoped_ptr<GLHelper> old_helper(gl_helper_.release()); | 504 scoped_ptr<GLHelper> old_helper(gl_helper_.release()); |
| 504 | 505 |
| 505 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 506 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 506 observer_list_, | 507 observer_list_, |
| 507 OnLostResources()); | 508 OnLostResources()); |
| 508 } | 509 } |
| 509 | 510 |
| 510 } // namespace content | 511 } // namespace content |
| OLD | NEW |